Image/video encoding/decoding method and apparatus using same

ABSTRACT

A video decoding method performed by a video decoding apparatus according to the present document may comprise the steps of: parsing a prediction weighted table syntax from a bitstream; parsing number information about weighted reference pictures in a reference picture list from the prediction weighted table syntax; deriving a weighting factor-related flag about the reference picture list on the basis of the number information; performing weighted prediction on a current block on the basis of the weighting factor-related flag so as to derive prediction samples of the current block; generating residual samples on the basis of residual information obtained from the bitstream; and reconstructing a current picture on the basis of the prediction samples and the residual samples, wherein the prediction weighted table syntax is parsed from a picture header of the bitstream.

BACKGROUND Technical Field

The present disclosure relates to a method and an apparatus forencoding/decoding an image/video.

Related Art

Recently, the demand for high resolution, high quality image/video suchas 4K, 8K or more Ultra High Definition (UHD) image/video is increasingin various fields. As the image/video resolution or quality becomeshigher, relatively more amount of information or bits are transmittedthan for conventional image/video data. Therefore, if image/video dataare transmitted via a medium such as an existing wired/wirelessbroadband line or stored in a legacy storage medium, costs fortransmission and storage are readily increased.

Moreover, interests and demand are growing for virtual reality (VR) andartificial reality (AR) contents, and immersive media such as hologram;and broadcasting of images/videos exhibiting image/video characteristicsdifferent from those of an actual image/video, such as gameimages/videos, are also growing.

Therefore, a highly efficient image/video compression technique isrequired to effectively compress and transmit, store, or play highresolution, high quality images/videos showing various characteristicsas described above.

SUMMARY

A technical subject of the present document is to provide a method andan apparatus for enhancing efficiency in video/image coding.

Another technical subject of the present document is to provide a methodand an apparatus for efficiently performing weighted prediction in interprediction.

Still another technical subject of the present document is to provide amethod and an apparatus for efficiently signaling information onweighted prediction.

Yet another technical subject of the present document is to provide amethod and an apparatus for reducing signaling overhead in transmittinginformation on weighted prediction.

According to an embodiment of the present document, a video decodingmethod performed by a video decoding apparatus may include parsing aprediction weighted table syntax from a bitstream, parsing numberinformation on weighted reference pictures in a reference picture listfrom the prediction weighted table syntax, deriving a weightingfactor-related flag for the reference picture list based on the numberinformation, deriving prediction samples for a current block byperforming weighted prediction on the current block based on theweighting factor-related flag, generating residual samples based onresidual information obtained from the bitstream, and reconstructing acurrent picture based on the prediction samples and the residualsamples, wherein the prediction weighted table syntax may be parsed froma picture header of the bitstream.

According to another embodiment of the present document, a videoencoding method performed by a video encoding apparatus may includederiving motion information on a current block, generating weightingfactor-related information for a reference picture list for weightedprediction and number information on weighted reference pictures in thereference picture list by performing the weighted prediction on thecurrent block based on the motion information, and encoding imageinformation comprising the weighting factor-related information and thenumber information, wherein the weighting factor-related information andthe number information may be included in a prediction weighted tablesyntax in the image information, and the prediction weighted tablesyntax may be included in a picture header of the image information.

According to still another embodiment of the present document, acomputer-readable digital storage medium may include information tocause a video decoding apparatus to perform a video decoding method, andthe video decoding method may include parsing a prediction weightedtable syntax from image information, parsing number information onweighted reference pictures in a reference picture list from theprediction weighted table syntax, deriving a weighting factor-relatedflag for the reference picture list based on the number information,deriving prediction samples for a current block by performing weightedprediction on the current block based on the weighting factor-relatedflag, generating residual samples based on residual information obtainedfrom the image information, and reconstructing a current picture basedon the prediction samples and the residual samples, wherein theprediction weighted table syntax may be parsed from a picture header ofthe image information.

According to an embodiment of the present document, it is possible toenhance overall video/image compression efficiency.

According to an embodiment of the present document, it is possible toefficiently perform weighted prediction in inter prediction.

According to an embodiment of the present document, it is possible toefficiently signal information on weighted prediction.

According to an embodiment of the present document, it is possible toreduce redundant signaling in transmitting information on weightedprediction.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 schematically illustrates an example of a video/image codingsystem to which embodiments of the present document are applicable.

FIG. 2 is a diagram schematically illustrating a configuration of avideo/image encoding apparatus to which the embodiments of the presentdocument are applicable.

FIG. 3 is a diagram schematically illustrating a configuration of avideo/image decoding apparatus to which the embodiments of the presentdocument are applicable.

FIG. 4 illustrates an example of encoding a single syntax element.

FIG. 5 illustrates an example of an inter prediction-based video/imageencoding method.

FIG. 6 schematically illustrates an inter predictor in an encodingapparatus.

FIG. 7 illustrates an example of an inter prediction-based video/imagedecoding method.

FIG. 8 schematically illustrates an inter predictor in a decodingapparatus.

FIG. 9 and FIG. 10 schematically illustrate an example of a video/imageencoding method and related components according to an embodiment of thepresent document.

FIG. 11 and FIG. 12 schematically illustrate an example of a video/imagedecoding method and related components according to an embodiment of thepresent document.

FIG. 13 illustrates an example of a content streaming system to whichembodiments disclosed in the present document are applicable.

DESCRIPTION OF EXEMPLARY EMBODIMENTS

The disclosure of the present document may be modified in various forms,and specific embodiments thereof will be described and illustrated inthe drawings. The terms used in the present document are used to merelydescribe specific embodiments, but are not intended to limit thedisclosed method in the present document. An expression of a singularnumber includes an expression of ‘at least one’, so long as it isclearly read differently. The terms such as “include” and “have” areintended to indicate that features, numbers, steps, operations,elements, components, or combinations thereof used in the document existand it should be thus understood that the possibility of existence oraddition of one or more different features, numbers, steps, operations,elements, components, or combinations thereof is not excluded.

In addition, each configuration of the drawings described in the presentdocument is an independent illustration for explaining functions asfeatures that are different from each other, and does not mean that eachconfiguration is implemented by mutually different hardware or differentsoftware. For example, two or more of the configurations may be combinedto form one configuration, and one configuration may also be dividedinto multiple configurations. Without departing from the gist of thedisclosed method of the present document, embodiments in whichconfigurations are combined and/or separated are included in the scopeof the disclosure of the present document.

The present document relates to video/image coding. For example, amethod/embodiment disclosed in the present document may be applied to amethod disclosed in a versatile video coding (VVC) standard. Inaddition, the method/embodiment disclosed in the present document may beapplied to a method disclosed in an essential video coding (EVC)standard, AOMedia Video 1 (AV1) standard, 2nd generation of audio videocoding standard (AVS2), or a next-generation video/image coding standard(e.g., H.267, H.268, etc.).

Various embodiments related to video/image coding are presented in thepresent document, and the embodiments may be combined with each otherunless otherwise stated.

In the present document, the term “/” and “,” should be interpreted toindicate “and/or.” For instance, the expression “A/B” may mean “A and/orB.” Further, “A, B” may mean “A and/or B.” Further, “A/B/C” may mean “atleast one of A, B, and/or C.” Also, “A/B/C” may mean “at least one of A,B, and/or C.”

Further, in the document, the term “or” should be interpreted toindicate “and/or.” For instance, the expression “A or B” may comprise 1)only A, 2) only B, and/or 3) both A and B. In other words, the term “or”in the present document should be interpreted to indicate “additionallyor alternatively.”

Further, the parentheses used in the present document may mean “forexample”. Specifically, in case that “prediction (intra prediction)” isexpressed, it may be indicated that “intra prediction” is proposed as anexample of “prediction”. In other words, the term “prediction” in thepresent document is not limited to “intra prediction”, and “intraprediction” is proposed as an example of “prediction”. Further, even incase that “prediction (i.e., intra prediction)” is expressed, it may beindicated that “intra prediction” is proposed as an example of“prediction”.

In the present document, technical features individually explained inone drawing may be individually implemented or simultaneouslyimplemented.

Hereinafter, embodiments of the present document will be described indetail with reference to the accompanying drawings. In addition, likereference numerals are used to indicate like elements throughout thedrawings, and the same descriptions on the like elements may be omitted.

FIG. 1 illustrates an example of a video/image coding system to whichthe embodiments of the present document may be applied.

Referring to FIG. 1, a video/image coding system may include a firstdevice (a source device) and a second device (a reception device). Thesource device may transmit encoded video/image information or data tothe reception device through a digital storage medium or network in theform of a file or streaming

The source device may include a video source, an encoding apparatus, anda transmitter. The receiving device may include a receiver, a decodingapparatus, and a renderer. The encoding apparatus may be called avideo/image encoding apparatus, and the decoding apparatus may be calleda video/image decoding apparatus. The transmitter may be included in theencoding apparatus. The receiver may be included in the decodingapparatus. The renderer may include a display, and the display may beconfigured as a separate device or an external component.

The video source may acquire video/image through a process of capturing,synthesizing, or generating the video/image. The video source mayinclude a video/image capture device and/or a video/image generatingdevice. The video/image capture device may include, for example, one ormore cameras, video/image archives including previously capturedvideo/images, and the like. The video/image generating device mayinclude, for example, computers, tablets and smartphones, and may(electronically) generate video/images. For example, a virtualvideo/image may be generated through a computer or the like. In thiscase, the video/image capturing process may be replaced by a process ofgenerating related data.

The encoding apparatus may encode input video/image. The encodingapparatus may perform a series of procedures such as prediction,transform, and quantization for compaction and coding efficiency. Theencoded data (encoded video/image information) may be output in the formof a bitstream.

The transmitter may transmit the encoded image/image information or dataoutput in the form of a bitstream to the receiver of the receivingdevice through a digital storage medium or a network in the form of afile or streaming The digital storage medium may include various storagemediums such as USB, SD, CD, DVD, Blu-ray, HDD, SSD, and the like. Thetransmitter may include an element for generating a media file through apredetermined file format and may include an element for transmissionthrough a broadcast/communication network. The receiver mayreceive/extract the bitstream and transmit the received bitstream to thedecoding apparatus.

The decoding apparatus may decode the video/image by performing a seriesof procedures such as dequantization, inverse transform, and predictioncorresponding to the operation of the encoding apparatus.

The renderer may render the decoded video/image. The renderedvideo/image may be displayed through the display.

In the present document, a video may refer to a series of images overtime. A picture generally refers to the unit representing one image at aparticular time frame, and a slice/tile refers to the unit constitutinga part of the picture in terms of coding. A slice/tile may include oneor more coding tree units (CTUs). One picture may consist of one or moreslices/tiles. One picture may consist of one or more tile groups. Onetile group may include one or more tiles. A brick may represent arectangular region of CTU rows within a tile in a picture). A tile maybe partitioned into multiple bricks, each of which consisting of one ormore CTU rows within the tile. A tile that is not partitioned intomultiple bricks may be also referred to as a brick. A brick scan is aspecific sequential ordering of CTUs partitioning a picture in which theCTUs are ordered consecutively in CTU raster scan in a brick, brickswithin a tile are ordered consecutively in a raster scan of the bricksof the tile, and tiles in a picture are ordered consecutively in araster scan of the tiles of the picture. A tile is a rectangular regionof CTUs within a particular tile column and a particular tile row in apicture. The tile column is a rectangular region of CTUs having a heightequal to the height of the picture and a width specified by syntaxelements in the picture parameter set. The tile row is a rectangularregion of CTUs having a height specified by syntax elements in thepicture parameter set and a width equal to the width of the picture). Atile scan is a specific sequential ordering of CTUs partitioning apicture in which the CTUs are ordered consecutively in CTU raster scanin a tile whereas tiles in a picture are ordered consecutively in araster scan of the tiles of the picture.

A slice includes an integer number of bricks of a picture that may beexclusively contained in a single NAL unit. A slice may consist ofeither a number of complete tiles or only a consecutive sequence ofcomplete bricks of one tile. In the present document, tile group andslice may be used interchangeably. For example, in the present document,a tile group/tile group header may be referred to as a slice/sliceheader.

A pixel or a pel may mean a smallest unit constituting one picture (orimage). Also, ‘sample’ may be used as a term corresponding to a pixel. Asample may generally represent a pixel or a value of a pixel, and mayrepresent only a pixel/pixel value of a luma component or only apixel/pixel value of a chroma component.

A unit may represent a basic unit of image processing. The unit mayinclude at least one of a specific region of the picture and informationrelated to the region. One unit may include one luma block and twochroma (ex. Cb, cr) blocks. The unit may be used interchangeably withterms such as block or area in some cases. In a general case, an MxNblock may include samples (or sample arrays) or a set (or array) oftransform coefficients of M columns and N rows. Alternatively, thesample may mean a pixel value in the spatial domain, and when such apixel value is transformed to the frequency domain, it may mean atransform coefficient in the frequency domain.

The unit may be interchangeably used with the term such as a block or anarea in some cases. Generally, an M×N block may represent samplescomposed of M columns and N rows or a group of transform coefficients.The sample may generally represent a pixel or a value of the pixel, andmay also represent only the pixel/pixel value of a luma component, andalso represent only the pixel/pixel value of a chroma component. Thesample may be used as the term corresponding to a pixel or a pelconfiguring one picture (or image).

FIG. 2 is a diagram schematically illustrating the configuration of avideo/image encoding apparatus to which the embodiments of the presentdocument may be applied. Hereinafter, what is referred to as the videoencoding apparatus may include an image encoding apparatus.

Referring to FIG. 2, the encoding apparatus 200 may include and beconfigured with an image partitioner 210, a predictor 220, a residualprocessor 230, an entropy encoder 240, an adder 250, a filter 260, and amemory 270. The predictor 220 may include an inter predictor 221 and anintra predictor 222. The residual processor 230 may include atransformer 232, a quantizer 233, a dequantizer 234, and an inversetransformer 235. The residual processor 230 may further include asubtractor 231. The adder 250 may be called a reconstructor orreconstructed block generator. The image partitioner 210, the predictor220, the residual processor 230, the entropy encoder 240, the adder 250,and the filter 260, which have been described above, may be configuredby one or more hardware components (e.g., encoder chipsets orprocessors) according to an embodiment. In addition, the memory 270 mayinclude a decoded picture buffer (DPB), and may also be configured by adigital storage medium. The hardware component may further include thememory 270 as an internal/external component.

The image partitioner 210 may split an input image (or, picture, frame)input to the encoding apparatus 200 into one or more processing units.As an example, the processing unit may be called a coding unit (CU). Inthis case, the coding unit may be recursively split according to aQuad-tree binary-tree ternary-tree (QTBTTT) structure from a coding treeunit (CTU) or the largest coding unit (LCU). For example, one codingunit may be split into a plurality of coding units of a deeper depthbased on a quad-tree structure, a binary-tree structure, and/or aternary-tree structure. In this case, for example, the quad-treestructure is first applied and the binary-tree structure and/or theternary-tree structure may be later applied. Alternatively, thebinary-tree structure may also be first applied. A coding procedureaccording to the present document may be performed based on a finalcoding unit which is not split any more. In this case, based on codingefficiency according to image characteristics or the like, the maximumcoding unit may be directly used as the final coding unit, or asnecessary, the coding unit may be recursively split into coding units ofa deeper depth, such that a coding unit having an optimal size may beused as the final coding unit. Here, the coding procedure may include aprocedure such as prediction, transform, and reconstruction to bedescribed later. In another example, the processing unit may furtherinclude a prediction unit (PU) or a transform unit (TU). In this case,each of the prediction unit and the transform unit may be split orpartitioned from the aforementioned final coding unit. The predictionunit may be a unit of sample prediction, and the transform unit may be aunit for inducing a transform coefficient and/or a unit for inducing aresidual signal from the transform coefficient.

The encoding apparatus 200 may subtract the prediction signal (predictedblock, prediction sample array) output from the inter predictor 221 orthe intra predictor 222 from the input image signal (original block,original sample array) to generate a residual signal (residual block,residual sample array), and the generated residual signal is transmittedto the transformer 232. In this case, as illustrated, a unit forsubtracting the prediction signal (prediction block, prediction samplearray) from an input image signal (original block, original samplearray) in the encoder 200 may be referred to as a subtractor 231. Thepredictor 220 may perform prediction on a processing target block(hereinafter, referred to as a current block) and generate a predictedblock including prediction samples for the current block. The predictor220 may determine whether intra prediction or inter prediction isapplied in units of a current block or CU. The predictor 220 maygenerate various kinds of information on prediction, such as predictionmode information, and transmit the generated information to the entropyencoder 240, as is described below in the description of each predictionmode. The information on prediction may be encoded by the entropyencoder 240 and output in the form of a bitstream.

The intra predictor 222 may predict a current block with reference tosamples within a current picture. The referenced samples may be locatedneighboring to the current block, or may also be located away from thecurrent block according to the prediction mode. The prediction modes inthe intra prediction may include a plurality of non-directional modesand a plurality of directional modes. The non-directional mode mayinclude, for example, a DC mode or a planar mode. The directional modemay include, for example, 33 directional prediction modes or 65directional prediction modes according to the fine degree of theprediction direction. However, this is illustrative and the directionalprediction modes which are more or less than the above number may beused according to the setting. The intra predictor 222 may alsodetermine the prediction mode applied to the current block using theprediction mode applied to the neighboring block.

The inter predictor 221 may induce a predicted block of the currentblock based on a reference block (reference sample array) specified by amotion vector on a reference picture. At this time, in order to decreasethe amount of motion information transmitted in the inter predictionmode, the motion information may be predicted in units of a block, asub-block, or a sample based on the correlation of the motioninformation between the neighboring block and the current block. Themotion information may include a motion vector and a reference pictureindex. The motion information may further include inter predictiondirection (LO prediction, L1 prediction, Bi prediction, or the like)information. In the case of the inter prediction, the neighboring blockmay include a spatial neighboring block existing within the currentpicture and a temporal neighboring block existing in the referencepicture. The reference picture including the reference block and thereference picture including the temporal neighboring block may also bethe same as each other, and may also be different from each other. Thetemporal neighboring block may be called the name such as a collocatedreference block, a collocated CU (colCU), or the like, and the referencepicture including the temporal neighboring block may also be called acollocated picture (colPic). For example, the inter predictor 221 mayconfigure a motion information candidate list based on the neighboringblocks, and generate information indicating what candidate is used toderive the motion vector and/or the reference picture index of thecurrent block. The inter prediction may be performed based on variousprediction modes, and for example, in the case of a skip mode and amerge mode, the inter predictor 221 may use the motion information ofthe neighboring block as the motion information of the current block. Inthe case of the skip mode, the residual signal may not be transmittedunlike the merge mode. A motion vector prediction (MVP) mode mayindicate the motion vector of the current block by using the motionvector of the neighboring block as a motion vector predictor, andsignaling a motion vector difference.

The predictor 220 may generate a prediction signal based on variousprediction methods to be described below. For example, the predictor 220may apply intra prediction or inter prediction for prediction of oneblock and may simultaneously apply intra prediction and interprediction. This may be called combined inter and intra prediction(CIIP). In addition, the predictor may be based on an intra block copy(IBC) prediction mode or based on a palette mode for prediction of ablock. The IBC prediction mode or the palette mode may be used forimage/video coding of content such as games, for example, screen contentcoding (SCC). IBC basically performs prediction within the currentpicture, but may be performed similarly to inter prediction in that areference block is derived within the current picture. That is, IBC mayuse at least one of the inter prediction techniques described in thepresent document. The palette mode may be viewed as an example of intracoding or intra prediction. When the palette mode is applied, a samplevalue in the picture may be signaled based on information on the palettetable and the palette index.

The prediction signal generated by the predictor (including the interpredictor 221 and/or the intra predictor 222) may be used to generate areconstructed signal or may be used to generate a residual signal.

The transformer 232 may generate transform coefficients by applying atransform technique to the residual signal. For example, the transformtechnique may include at least one of a discrete cosine transform (DCT),a discrete sine transform (DST), a graph-based transform (GBT), or aconditionally non-linear transform (CNT). Here, GBT refers totransformation obtained from a graph when expressing relationshipinformation between pixels in the graph. CNT refers to transformationobtained based on a prediction signal generated using all previouslyreconstructed pixels. Also, the transformation process may be applied toa block of pixels having the same size as a square or may be applied toa block of a variable size that is not a square.

The quantizer 233 quantizes the transform coefficients and transmits thesame to the entropy encoder 240, and the entropy encoder 240 encodes thequantized signal (information on the quantized transform coefficients)and outputs the encoded signal as a bitstream. Information on thequantized transform coefficients may be referred to as residualinformation. The quantizer 233 may rearrange the quantized transformcoefficients in the block form into a one-dimensional vector form basedon a coefficient scan order and may generate information on thetransform coefficients based on the quantized transform coefficients inthe one-dimensional vector form.

The entropy encoder 240 may perform various encoding methods such as,for example, exponential Golomb, context-adaptive variable length coding(CAVLC), and context-adaptive binary arithmetic coding (CABAC). Theentropy encoder 240 may encode information necessary for video/imagereconstruction (e.g., values of syntax elements, etc.) other than thequantized transform coefficients together or separately. Encodedinformation (e.g., encoded video/image information) may be transmittedor stored in units of a network abstraction layer (NAL) unit in the formof a bitstream. The video/image information may further includeinformation on various parameter sets, such as an adaptation parameterset (APS), a picture parameter set (PPS), a sequence parameter set(SPS), or a video parameter set (VPS). Also, the video/image informationmay further include general constraint information. In the presentdocument, information and/or syntax elements transmitted/signaled fromthe encoding apparatus to the decoding apparatus may be included invideo/image information. The video/image information may be encodedthrough the encoding procedure described above and included in thebitstream. The bitstream may be transmitted through a network or may bestored in a digital storage medium. Here, the network may include abroadcasting network and/or a communication network, and the digitalstorage medium may include various storage media such as USB, SD, CD,DVD, Blu-ray, HDD, and SSD. A transmitting unit (not shown) and/or astoring unit (not shown) for transmitting or storing a signal outputfrom the entropy encoder 240 may be configured as internal/externalelements of the encoding apparatus 200, or the transmitting unit may beincluded in the entropy encoder 240.

The quantized transform coefficients output from the quantizer 233 maybe used to generate a prediction signal. For example, the residualsignal (residual block or residual samples) may be reconstructed byapplying dequantization and inverse transform to the quantized transformcoefficients through the dequantizer 234 and the inverse transform unit235. The adder 250 may add the reconstructed residual signal to theprediction signal output from the inter predictor 221 or the intrapredictor 222 to generate a reconstructed signal (reconstructed picture,reconstructed block, reconstructed sample array). When there is noresidual for the processing target block, such as when the skip mode isapplied, the predicted block may be used as a reconstructed block. Theadder 250 may be referred to as a restoration unit or a restorationblock generator. The generated reconstructed signal may be used forintra prediction of a next processing target block in the currentpicture, or may be used for inter prediction of the next picture afterbeing filtered as described below.

Meanwhile, luma mapping with chroma scaling (LMCS) may be applied duringa picture encoding and/or reconstruction process.

The filter 260 may improve subjective/objective image quality byapplying filtering to the reconstructed signal. For example, the filter260 may generate a modified reconstructed picture by applying variousfiltering methods to the reconstructed picture, and store the modifiedreconstructed picture in the memory 270, specifically, in a DPB of thememory 270. The various filtering methods may include, for example,deblocking filtering, a sample adaptive offset, an adaptive loop filter,a bilateral filter, and the like. The filter 260 may generate variouskinds of information related to the filtering, and transfer thegenerated information to the entropy encoder 240 as described later inthe description of each filtering method. The information related to thefiltering may be encoded by the entropy encoder 240 and output in theform of a bitstream.

The modified reconstructed picture transmitted to the memory 270 may beused as a reference picture in the inter predictor 221. When the interprediction is applied through the encoding apparatus, predictionmismatch between the encoding apparatus 200 and the decoding apparatusmay be avoided and encoding efficiency may be improved.

The DPB of the memory 270 may store the modified reconstructed picturefor use as the reference picture in the inter predictor 221. The memory270 may store motion information of a block from which the motioninformation in the current picture is derived (or encoded) and/or motioninformation of blocks in the picture, having already been reconstructed.The stored motion information may be transferred to the inter predictor221 to be utilized as motion information of the spatial neighboringblock or motion information of the temporal neighboring block. Thememory 270 may store reconstructed samples of reconstructed blocks inthe current picture, and may transfer the reconstructed samples to theintra predictor 222.

FIG. 3 is a diagram for schematically explaining the configuration of avideo/image decoding apparatus to which the embodiments of the presentdocument may be applied.

Referring to FIG. 3, the decoding apparatus 300 may include andconfigured with an entropy decoder 310, a residual processor 320, apredictor 330, an adder 340, a filter 350, and a memory 360. Thepredictor 330 may include an inter predictor 331 and an intra predictor332. The residual processor 320 may include a dequantizer 321 and aninverse transformer 322. The entropy decoder 310, the residual processor320, the predictor 330, the adder 340, and the filter 350, which havebeen described above, may be configured by one or more hardwarecomponents (e.g., decoder chipsets or processors) according to anembodiment. Further, the memory 360 may include a decoded picture buffer(DPB), and may be configured by a digital storage medium. The hardwarecomponent may further include the memory 360 as an internal/externalcomponent.

When the bitstream including the video/image information is input, thedecoding apparatus 300 may reconstruct the image in response to aprocess in which the video/image information is processed in theencoding apparatus illustrated in FIG. 2. For example, the decodingapparatus 300 may derive the units/blocks based on block split-relatedinformation acquired from the bitstream. The decoding apparatus 300 mayperform decoding using the processing unit applied to the encodingapparatus. Therefore, the processing unit for the decoding may be, forexample, a coding unit, and the coding unit may be split according tothe quad-tree structure, the binary-tree structure, and/or theternary-tree structure from the coding tree unit or the maximum codingunit. One or more transform units may be derived from the coding unit.In addition, the reconstructed image signal decoded and output throughthe decoding apparatus 300 may be reproduced through a reproducingapparatus.

The decoding apparatus 300 may receive a signal output from the encodingapparatus of FIG. 2 in the form of a bitstream, and the received signalmay be decoded through the entropy decoder 310. For example, the entropydecoder 310 may parse the bitstream to derive information (e.g.,video/image information) necessary for image reconstruction (or picturereconstruction). The video/image information may further includeinformation on various parameter sets such as an adaptation parameterset (APS), a picture parameter set (PPS), a sequence parameter set(SPS), or a video parameter set (VPS). In addition, the video/imageinformation may further include general constraint information. Thedecoding apparatus may further decode picture based on the informationon the parameter set and/or the general constraint information.Signaled/received information and/or syntax elements described later inthe present document may be decoded may decode the decoding procedureand obtained from the bitstream. For example, the entropy decoder 310decodes the information in the bitstream based on a coding method suchas exponential Golomb coding, context-adaptive variable length coding(CAVLC), or context-adaptive arithmetic coding (CABAC), and outputsyntax elements required for image reconstruction and quantized valuesof transform coefficients for residual. More specifically, the CABACentropy decoding method may receive a bin corresponding to each syntaxelement in the bitstream, determine a context model by using a decodingtarget syntax element information, decoding information of a decodingtarget block or information of a symbol/bin decoded in a previous stage,and perform an arithmetic decoding on the bin by predicting aprobability of occurrence of a bin according to the determined contextmodel, and generate a symbol corresponding to the value of each syntaxelement. In this case, the CABAC entropy decoding method may update thecontext model by using the information of the decoded symbol/bin for acontext model of a next symbol/bin after determining the context model.The information related to the prediction among the information decodedby the entropy decoder 310 may be provided to the predictor (interpredictor 332 and intra predictor 331), and residual values on which theentropy decoding has been performed in the entropy decoder 310, that is,the quantized transform coefficients and related parameter information,may be input to the residual processor 320.

The residual processor 320 may derive a residual signal (residual block,residual samples, or residual sample array). Also, information onfiltering among the information decoded by the entropy decoder 310 maybe provided to the filter 350. Meanwhile, a receiving unit (not shown)for receiving a signal output from the encoding apparatus may be furtherconfigured as an internal/external element of the decoding apparatus300, or the receiving unit may be a component of the entropy decoder310. Meanwhile, the decoding apparatus according to the present documentmay be called a video/image/picture decoding apparatus, and the decodingapparatus may be divided into an information decoder(video/image/picture information decoder) and a sample decoder(video/image/picture sample decoder). The information decoder mayinclude the entropy decoder 310, and the sample decoder may include atleast one of the dequantizer 321, the inverse transformer 322, the adder340, the filter 350, the memory 360, an inter predictor 332, and anintra predictor 331.

The dequantizer 321 may dequantize the quantized transform coefficientsto output the transform coefficients. The dequantizer 321 may rearrangethe quantized transform coefficients in a two-dimensional block form. Inthis case, the rearrangement may be performed based on a coefficientscan order performed by the encoding apparatus. The dequantizer 321 mayperform dequantization for the quantized transform coefficients using aquantization parameter (e.g., quantization step size information), andacquire the transform coefficients.

The inverse transformer 322 inversely transforms the transformcoefficients to acquire the residual signal (residual block, residualsample array).

In the present document, at least one of quantization/dequantizationand/or transform/inverse transform may be omitted. When thequantization/dequantization is omitted, the quantized transformcoefficient may be referred to as a transform coefficient. When thetransform/inverse transform is omitted, the transform coefficient may becalled a coefficient or a residual coefficient or may still be calledthe transform coefficient for uniformity of expression.

In the present document, the quantized transform coefficient and thetransform coefficient may be referred to as a transform coefficient anda scaled transform coefficient, respectively. In this case, the residualinformation may include information on transform coefficient(s), and theinformation on the transform coefficient(s) may be signaled throughresidual coding syntax. Transform coefficients may be derived based onthe residual information (or information on the transformcoefficient(s)), and scaled transform coefficients may be derivedthrough inverse transform (scaling) on the transform coefficients.Residual samples may be derived based on inverse transform (transform)of the scaled transform coefficients. This may be applied/expressed inother parts of the present document as well.

The predictor 330 may perform the prediction of the current block, andgenerate a predicted block including the prediction samples of thecurrent block. The predictor may determine whether the intra predictionis applied or the inter prediction is applied to the current block basedon the information on prediction output from the entropy decoder 310,and determine a specific intra/inter prediction mode.

The predictor 330 may generate a prediction signal based on variousprediction methods to be described later. For example, the predictor mayapply intra prediction or inter prediction for prediction of one block,and may simultaneously apply intra prediction and inter prediction. Thismay be called combined inter and intra prediction (CIIP). In addition,the predictor may be based on an intra block copy (IBC) prediction modeor based on a palette mode for prediction of a block. The IBC predictionmode or the palette mode may be used for image/video coding of contentsuch as games, for example, screen content coding (SCC). IBC maybasically perform prediction within the current picture, but may beperformed similarly to inter prediction in that a reference block isderived within the current picture. That is, IBC may use at least one ofthe inter prediction techniques described in the present document. Thepalette mode may be considered as an example of intra coding or intraprediction. When the palette mode is applied, information on the palettetable and the palette index may be included in the video/imageinformation and signaled.

The intra predictor 331 may predict the current block by referring tothe samples in the current picture. The referred samples may be locatedin the neighborhood of the current block, or may be located apart fromthe current block according to the prediction mode. In intra prediction,prediction modes may include a plurality of non-directional modes and aplurality of directional modes. The intra predictor 331 may determinethe prediction mode to be applied to the current block by using theprediction mode applied to the neighboring block.

The inter predictor 332 may derive a predicted block for the currentblock based on a reference block (reference sample array) specified by amotion vector on a reference picture. In this case, in order to reducethe amount of motion information being transmitted in the interprediction mode, motion information may be predicted in the unit ofblocks, subblocks, or samples based on correlation of motion informationbetween the neighboring block and the current block. The motioninformation may include a motion vector and a reference picture index.The motion information may further include information on interprediction direction (L0 prediction, L1 prediction, Bi prediction, andthe like). In case of inter prediction, the neighboring block mayinclude a spatial neighboring block existing in the current picture anda temporal neighboring block existing in the reference picture. Forexample, the inter predictor 332 may construct a motion informationcandidate list based on neighboring blocks, and derive a motion vectorof the current block and/or a reference picture index based on thereceived candidate selection information. Inter prediction may beperformed based on various prediction modes, and the information on theprediction may include information indicating a mode of inter predictionfor the current block.

The adder 340 may generate a reconstructed signal (reconstructedpicture, reconstructed block, or reconstructed sample array) by addingthe obtained residual signal to the prediction signal (predicted blockor predicted sample array) output from the predictor (including interpredictor 332 and/or intra predictor 331). If there is no residual forthe processing target block, such as a case that a skip mode is applied,the predicted block may be used as the reconstructed block.

The adder 340 may be called a reconstructor or a reconstructed blockgenerator. The generated reconstructed signal may be used for the intraprediction of a next block to be processed in the current picture, andas described later, may also be output through filtering or may also beused for the inter prediction of a next picture.

Meanwhile, a luma mapping with chroma scaling (LMCS) may also be appliedin the picture decoding process.

The filter 350 may improve subjective/objective image quality byapplying filtering to the reconstructed signal. For example, the filter350 may generate a modified reconstructed picture by applying variousfiltering methods to the reconstructed picture, and store the modifiedreconstructed picture in the memory 360, specifically, in a DPB of thememory 360. The various filtering methods may include, for example,deblocking filtering, a sample adaptive offset, an adaptive loop filter,a bilateral filter, and the like.

The (modified) reconstructed picture stored in the DPB of the memory 360may be used as a reference picture in the inter predictor 332. Thememory 360 may store the motion information of the block from which themotion information in the current picture is derived (or decoded) and/orthe motion information of the blocks in the picture having already beenreconstructed. The stored motion information may be transferred to theinter predictor 332 so as to be utilized as the motion information ofthe spatial neighboring block or the motion information of the temporalneighboring block. The memory 360 may store reconstructed samples ofreconstructed blocks in the current picture, and transfer thereconstructed samples to the intra predictor 331.

In the present document, the embodiments described in the filter 260,the inter predictor 221, and the intra predictor 222 of the encodingapparatus 200 may be applied equally or to correspond to the filter 350,the inter predictor 332, and the intra predictor 331.

Meanwhile, the video/image coding method according to the presentdocument may be performed based on the following partitioning structure.Specifically, above described procedures of prediction, residualprocessing ((inverse) transform and (de)quantization), syntax elementcoding, and filtering may be performed based on CTU and CU (and/or TUand PU) derived based on the partitioning structure. A blockpartitioning procedure may be performed by the image partitioner 210 ofthe above-described encoding apparatus, and partitioning-relatedinformation may be (encoding) processed by the entropy encoder 240, andmay be transferred to the decoding apparatus in the form of a bitstream.The entropy decoder 310 of the decoding apparatus may derive the blockpartitioning structure of the current picture based on thepartitioning-related information obtained from the bitstream, and basedon this, may perform a series of procedures (e.g., prediction, residualprocessing, block/picture reconstruction, in-loop filtering, and thelike) for image decoding. The CU size and the TU size may be equal toeach other, or a plurality of TUs may be present within a CU region.Meanwhile, the CU size may generally represent a luma component (sample)coding block (CB) size. The TU size may generally represent a lumacomponent (sample) transform block (TB) size. The chroma component(sample) CB or TB size may be derived based on the luma component(sample) CB or TB size in accordance with a component ratio according toa color format (chroma format, e.g., 4:4:4, 4:2:2, 4:2:0 and the like)of a picture/image. The TU size may be derived based on maxTbSize. Forexample, if the CU size is larger than the maxTbSize, a plurality of TUs(TBs) of the maxTbSize may be derived from the CU, and thetransform/inverse transform may be performed in the unit of TU (TB).Further, for example, in case that intra prediction is applied, theintra prediction mode/type may be derived in the unit of CU (or CB), andneighboring reference sample derivation and prediction sample generationprocedures may be performed in the unit of TU (or TB). In this case, oneor a plurality of TUs (or TBs) may be present in one CU (or CB) region,and in this case, the plurality of TUs (or TBs) may share the same intraprediction mode/type.

Further, in the video/image coding according to the present document, animage processing unit may have a hierarchical structure. One picture maybe partitioned into one or more tiles, bricks, slices, and/or tilegroups. One slice may include one or more bricks. On brick may includeone or more CTU rows within a tile. The slice may include an integernumber of bricks of a picture. One tile group may include one or moretiles. One tile may include one or more CTUs. The CTU may be partitionedinto one or more CUs. A tile represents a rectangular region of CTUswithin a particular tile column and a particular tile row in a picture.A tile group may include an integer number of tiles according to a tileraster scan in the picture. A slice header may carryinformation/parameters that can be applied to the corresponding slice(blocks in the slice). In case that the encoding/decoding apparatus hasa multi-core processor, encoding/decoding processes for the tiles,slices, bricks, and/or tile groups may be processed in parallel. In thepresent document, the slice or the tile group may be used exchangeably.That is, a tile group header may be called a slice header. Here, theslice may have one of slice types including intra (I) slice, predictive(P) slice, and bi-predictive (B) slice. In predicting blocks in I slice,inter prediction may not be used, and only intra prediction may be used.Of course, even in this case, signaling may be performed by coding theoriginal sample value without prediction. With respect to blocks in Pslice, intra prediction or inter prediction may be used, and in case ofusing the inter prediction, only uni-prediction can be used. Meanwhile,with respect to blocks in B slice, the intra prediction or interprediction may be used, and in case of using the inter prediction, up tobi-prediction can be maximally used.

The encoding apparatus may determine the tile/tile group, brick, slice,and maximum and minimum coding unit sizes in consideration of the codingefficiency or parallel processing, or according to the characteristics(e.g., resolution) of a video image, and information for them orinformation capable of inducing them may be included in the bitstream.

The decoding apparatus may obtain information representing the tile/tilegroup, brick, and slice of the current picture, and whether the CTU inthe tile has been partitioned into a plurality of coding units. Bymaking such information be obtained (transmitted) only under a specificcondition, the efficiency can be enhanced.

As described above, one picture may include a plurality of slices, andone slice may include a slice header and slice data. In this case, onepicture header may be further added for the plurality of slices (set ofslice headers and slice data) in the one picture. The picture header(picture header syntax) may include information/parameters commonlyapplicable to the picture. The slice header (slice header syntax) mayinclude information/parameters commonly applicable to the slice. Anadaptation parameter set (APS) or a picture parameter set (PPS) mayinclude information/parameters commonly applicable to one or morepictures. A sequence parameter set (SPS) may includeinformation/parameters commonly applicable to one or more sequences. Avideo parameter set (VPS) may include information/parameters commonlyapplicable to multiple layers. A decoding parameter set (DPS) mayinclude information/parameters commonly applicable to a video ingeneral. The DPS may include information/parameters related toconcatenation of coded video sequences (CVSs).

In the present document, a high-level syntax may include at least one ofan APS syntax, a PPS syntax, a SPS syntax, a VPS syntax, a DPS syntax, apicture header syntax, and a slice header syntax.

In addition, for example, information on partition and configuration ofthe tile/tile group/brick/slice may be configured in the encodingapparatus based on the high-level syntax and may be transmitted to thedecoding apparatus in the form of a bitstream.

FIG. 4 illustrates an example of encoding a single syntax element.

FIG. 4 is a block diagram illustrating CABAC for encoding a singlesyntax element. In an encoding procedure of CABAC, in a case where aninput signal is a syntax element which is not a binary value, the inputsignal is first converted into a binary value through binarization. In acase where an input signal is already a binary value, the input signalbypasses binarization without being subject to binarization. Here, eachbinary number of 0 or 1 forming the binary value is referred to as abin. For example, when a binary string (bin string) after thebinarization is 110, each of 1, 1, and 0 is referred to as a bin. Thebin(s) for a syntax element may represent a value of the syntax element.

Binarized bins are input to a regular coding engine or a bypass codingengine. The regular coding engine assigns a context model that reflectsa probability value for a corresponding bin and encodes the bin based onthe assigned context model. The regular coding engine may perform codingon each bin and may then update a probability model for the bin. Thesecoded bins are called context-coded bins. The bypass coding engine omitsa procedure of estimating the probability of an input bin and aprocedure of updating a probability model applied to the bin aftercoding. The bypass coding engine codes an input bin by applying auniform probability distribution (e.g., 50:50) instead of assigningcontext, thereby speeding up coding. These coded bins are called bypassbins. A context model may be assigned and updated for each bin to besubjected to context coding (regular coding), and may be indicated basedon ctxidx or ctxInc. ctxidx may be derived based on ctxInc.Specifically, for example, a context index (ctxidx) indicating a contextmodel for each bin to be subjected to regular coding may be derived asthe sum of a context index increment (ctxInc) and a context index offset(ctxIdxOffset). Here, ctxInc may be derived differently for each bin.ctxIdxOffset may be represented by the lowest value of ctxIdx. Thelowest value of ctxIdx may be referred to as an initial value(initValue) of ctxIdx. ctxIdxOffset is a value generally used todistinguish context models for other syntax elements, and a contextmodel for one syntax element may be distinguished/derived based onctxinc.

In an entropy encoding procedure, whether to perform the encodingthrough the regular encoding engine or through the bypass encodingengine may be determined, and an coding path may be switched. In entropydecoding, the same processes as those of the entropy encoding areperformed in a reverse order.

The foregoing entropy coding may be performed, for example, as follows.

An encoding apparatus (entropy encoder) performs an entropy codingprocedure on image/image information. The image/image information mayinclude partitioning-related information, prediction-related information(e.g., inter/intra prediction classification information, intraprediction mode information, and inter prediction mode information),residual information, in-loop filtering-related information, and thelike, or may include various syntax elements relating thereto. Theentropy coding may be performed by a unit of a syntax element.

Specifically, the encoding apparatus performs binarization on a targetsyntax element. The binarization may be based on various binarizationmethods, such as a truncated rice binarization process and afixed-length binarization process, and a binarization method for thetarget syntax element may be predefined. The binarization procedure maybe performed by a binarizer 242 in the entropy encoder 240.

The encoding apparatus performs entropy encoding on the target syntaxelement. The encoding apparatus may encode an empty string of the targetsyntax element based on regular coding (context) or bypass codingaccording to an entropy coding technique, such as context-adaptivearithmetic coding (CABAC) or context-adaptive variable length coding(CAVLC), and an output thereof may be included in a bitstream. Theentropy encoding procedure may be performed by an entropy encodingprocessor 243 in the entropy encoder 240. As described above, thebitstream may be delivered to a decoding apparatus through a (digital)storage medium or a network.

A decoding apparatus (entropy decoder) may decode encoded image/imageinformation. The image/image information may includepartitioning-related information, prediction-related information (e.g.,inter/intra prediction classification information, intra prediction modeinformation, and inter prediction mode information), residualinformation, in-loop filtering-related information, and the like, or mayinclude various syntax elements relating thereto. The entropy coding maybe performed by a unit of a syntax element.

Specifically, the decoding apparatus performs binarization on a targetsyntax element. Here, the binarization may be based on variousbinarization methods, such as a truncated rice binarization process anda fixed-length binarization process, and a binarization method for thetarget syntax element may be predefined. The decoding apparatus mayderive available empty strings (empty string candidates) for availablevalues of the target syntax element through the binarization procedure.The binarization procedure may be performed by a binarizer 312 in theentropy decoder 310.

The decoding apparatus performs entropy decoding on the target syntaxelement. The decoding apparatus compares a derived bin string withavailable bin strings for the syntax element while sequentially decodingand parsing each bin for the target syntax element from input bit(s) ina bitstream. When the derived bin string is the same as one of theavailable bin strings, a value corresponding to the bin string isderived as the value of the syntax element. Otherwise, the decodingapparatus further parses a next bit in the bitstream and then performsthe above procedure again. Through this process, specific informationmay be signaled using a variable length bit without using a start bit oran end bit for the specific information (specific syntax element) in thebitstream. Accordingly, a smaller number of bits may be allocated to alower value, and overall coding efficiency may be improved.

The decoding apparatus may perform context-based or bypass-baseddecoding on each bin in the bin string from the bitstream based on anentropy coding technique, such as CABAC or CAVLC. The entropy decodingprocedure may be performed by an entropy decoding processor 313 in theentropy decoder 310. The bitstream may include various pieces ofinformation for image/video decoding as described above. As describedabove, the bitstream may be delivered to the decoding apparatus througha (digital) storage medium or a network.

In this document, a table (syntax table) including syntax elements maybe used to indicate signaling of information from an encoding apparatusto a decoding apparatus. The order of the syntax elements of the tableincluding the syntax elements used in this document may indicate theparsing order of the syntax elements from a bitstream. The encodingapparatus may construct and encode the syntax table so that the syntaxelements may be parsed by the decoding apparatus in the parsing order,and the decoding apparatus may parse and decode the syntax elements ofthe syntax table from the bitstream according to the parsing order,thereby obtaining the values of the syntax elements.

A video/image encoding procedure based on inter prediction mayschematically include, for example, the following.

FIG. 5 illustrates an example of an inter prediction-based video/imageencoding method, and FIG. 6 schematically illustrates an inter predictorin an encoding apparatus.

Referring to FIG. 5 and FIG. 6, the encoding apparatus performs interprediction on a current block (S500). The encoding apparatus may derivean inter prediction mode and motion information on the current block,and may generate prediction samples for the current block. Here,procedures for determining the inter prediction mode, deriving themotion information, and generating the prediction samples may beperformed simultaneously, or one procedure may be performed beforeanother procedure. For example, the inter predictor 221 of the encodingapparatus may include a prediction mode determinator 221_1, a motioninformation deriver 221_2, and a prediction sample deriver 221_3,wherein the prediction mode determinator 221_1 may determine theprediction mode for the current block, the motion information deriver221_2 may derive the motion information on the current block, and theprediction sample deriver 221_3 may derive the prediction samples forthe current block. For example, the inter predictor of the encodingapparatus may search for a block similar to the current block within apredetermined area (search area) of reference pictures through motionestimation, and may derive a reference block having a difference fromthe current block that is a minimum or a predetermined reference levelor less. The inter predictor may derive a reference picture indexindicating a reference picture in which the reference block is locatedbased on the reference block, and may derive a motion vector based on apositional difference between the reference block and the current block.The encoding apparatus may determine a mode to be applied to the currentblock among various prediction modes. The encoding apparatus may comparerate-distortion (RD) costs of the various prediction modes and maydetermine an optimal prediction mode for the current block.

For example, when a skip mode or a merge mode is applied to the currentblock, the encoding apparatus may construct a merge candidate list, andmay derive a reference block having a difference from the current blockthat is the minimum or the predetermined reference level or less amongreference blocks indicated by merge candidates included in the mergecandidate list. In this case, a merge candidate associated with thederived reference block may be selected, and merge index informationindicating the selected merge candidate may be generated and signaled tothe decoding apparatus. The motion information on the current block maybe derived using motion information on the selected merge candidate.

In another example, when an (A)MVP mode is applied to the current block,the encoding apparatus may construct an (A)MVP candidate list, and mayuse a motion vector of a motion vector predictor (mvp) candidateselected from among mvp candidates included in the (A)MVP candidate listas an mvp of the current block. In this case, for example, a motionvector indicating a reference block derived by the motion estimation maybe used as a motion vector of the current block, and an mvp candidatehaving a motion vector having the smallest difference from the motionvector of the current block among the mvp candidates may be the selectedmvp candidate. A motion vector difference (MVD), which is a differenceobtained by subtracting the mvp from the motion vector of the currentblock, may be derived. In this case, information on the MVD may besignaled to the decoding device. When the (A)MVP mode is applied, thevalue of the reference picture index may be configured as referencepicture index information and may be separately signaled to the decodingapparatus.

The encoding apparatus may derive residual samples based on theprediction samples (S510). The encoding apparatus may derive theresidual samples by comparing original samples of the current block withthe prediction samples.

The encoding apparatus encodes image information including predictioninformation and residual information (S520). The encoding apparatus mayoutput the encoded image information in the form of a bitstream. Theprediction information is information related to the predictionprocedure, and may include prediction mode information (e.g., a skipflag, a merge flag, or a mode index) and information on motioninformation. The information on the motion information may includecandidate selection information (e.g., a merge index, an mvp flag, or anmvp index) that is information for deriving a motion vector. Inaddition, the information on the motion information may include theinformation on the MVD and/or reference picture index information.Further, the information on the motion information may includeinformation indicating whether L0 prediction, L1 prediction, orbi-prediction is applied. The residual information is information on theresidual samples. The residual information may include information onquantized transform coefficients for the residual samples.

The output bitstream may be stored in a (digital) storage medium and betransmitted to the decoding apparatus, or may be transmitted to thedecoding apparatus through a network.

As described above, the encoding apparatus may generate a reconstructedpicture (including reconstructed samples and reconstructed blocks) basedon the reference samples and the residual samples, which is for theencoding apparatus to derive the same prediction result as that derivedby the decoding apparatus and for increasing coding efficiency.Accordingly, the encoding apparatus may store the reconstructed picture(or reconstructed samples and reconstructed block) in the memory and mayuse the same as a reference picture for inter prediction. As describedabove, an in-loop filtering procedure may be further applied to thereconstructed picture.

A video/image decoding procedure based on inter prediction mayschematically include, for example, the following.

FIG. 7 illustrates an example of an inter prediction-based video/imagedecoding method, and FIG. 8 schematically illustrates an inter predictorin a decoding apparatus.

The decoding apparatus may perform an operation corresponding to theforegoing operation performed by the encoding apparatus. The decodingapparatus may predict the current block based on the received predictioninformation and may derive prediction samples.

Specifically, referring to FIG. 7 and FIG. 8, the decoding apparatus maydetermine a prediction mode for the current block based on theprediction information received from a bitstream (S700). The decodingapparatus may determine which inter prediction mode is applied to thecurrent block based on prediction mode information in the predictioninformation.

For example, whether the merge mode is applied to the current block orwhether the (A)MVP mode is determined may be determined based on themerge flag. Alternatively, one of various inter prediction modecandidates may be selected based on the merge index. The interprediction mode candidates may include various inter prediction modes,such as the skip mode, the merge mode, and/or the (A)MVP mode.

The decoding apparatus derives motion information on the current blockbased on the determined inter prediction mode (S710). For example, whenthe skip mode or the merge mode is applied to the current block, thedecoding apparatus may construct a merge candidate list to be describedlater and may select one merge candidate from among merge candidatesincluded in the merge candidate list. The selection may be performedbased on the foregoing selection information (merge index). The motioninformation on the current block may be derived using motion informationon the selected merge candidate. The motion information on the selectedmerge candidate may be used as the motion information on the currentblock.

In another example, when the (A)MVP mode is applied to the currentblock, the decoding apparatus may construct an (A)MVP candidate list,and may use a motion vector of a motion vector predictor (mvp) candidateselected from among mvp candidates included in the (A)MVP candidate listas an mvp of the current block. The selection may be performed based onthe foregoing selection information (mvp flag or mvp index). In thiscase, the decoding apparatus may derive an MVD of the current blockbased on the information on the MVD, and may derive a motion vector ofthe current block based on the mvp of the current block and the MVD.Further, the decoding apparatus may derive a reference picture index ofthe current block based on the reference picture index information. Apicture indicated by the reference picture index in a reference picturelist for the current block may be derived as a reference picturereferenced for inter prediction of the current block.

The motion information on the current block may be derived withoutconstructing a candidate list, in which case construction of a candidatelist described above may be omitted.

The decoding apparatus may generate prediction samples for the currentblock based on the motion information on the current block (S720). Inthis case, the reference picture may be derived based on the referencepicture index of the current block, and the prediction samples for thecurrent block may be derived using samples of a reference blockindicated by the motion vector of the current block in the referencepicture. In this case, as described later, a prediction sample filteringprocedure for all or some of the prediction samples for the currentblock may be further performed depending on the case.

For example, the inter predictor 332 of the decoding apparatus mayinclude a prediction mode determinator 332_1, a motion informationderiver 332_2, and a prediction sample deriver 332_3, wherein theprediction mode determinator 332_1 may determine the prediction mode forthe current block based on the received prediction mode information, themotion information deriver 332_2 may derive the motion information(motion vector and/or reference picture index) on the current blockbased on the received information on the motion information, and theprediction sample deriver 332_3 may derive the prediction samples forthe current block.

The decoding apparatus generates residual samples for the current blockbased on the received residual information (S730). The decodingapparatus may generate reconstructed samples for the current block basedon the prediction samples and the residual samples, and may generate areconstructed picture based reconstructed samples (S740). Subsequently,as described above, an in-loop filtering procedure may be furtherapplied to the reconstructed picture.

A predicted block for a current block may be derived based on motioninformation derived according to a prediction mode of the current block.The predicted block may include prediction samples (prediction samplearray) for the current block. When a motion vector of the current blockindicates a fractional sample unit, an interpolation procedure may beperformed, through which the prediction samples for the current blockmay be derived based on reference samples in a fractional sample unit ina reference picture. When affine inter prediction is applied to thecurrent block, the prediction samples may be generated based on a motionvector (MV) in a sample/subblock unit. When bi-prediction is applied,prediction samples derived through the weighted sum or weighted averageof prediction samples derived based on LO prediction (i.e., predictionusing a reference picture in reference picture list LO and MVLO) andprediction samples derived based on L1 prediction (i.e., predictionusing a reference picture in reference picture list L1 and MVL1)(according to phase) may be used as the prediction samples for thecurrent block. A case where bi-prediction is applied and the referencepicture used for L0 prediction and the reference picture used for L1prediction are located in different temporal directions with respect tothe current picture (i.e., corresponding to bi-prediction andbidirectional prediction) may be referred to as true bi-prediction.

As described above, reconstructed samples and reconstructed pictures maybe generated based on the derived prediction samples, after which anin-loop filtering procedures may be performed.

In inter prediction, weighted sample prediction may be used. Weightedsample prediction may be referred to as weighted prediction. Weightedprediction may be applied when the slice type of a current slice inwhich a current block (e.g., CU) is located is a P slice or a B slice.That is, weighted prediction may be used not only when bi-prediction isapplied but also when uni-prediction is applied. For example, asdescribed below, weighted prediction may be determined based onweightedPredFlag, and the value of weightedPredFlag may be determinedbased on signaled pps_weighted_pred_flag (in a case of a P slice) orpps_weighted_bipred_flag (in a case of a B slice). For example, whenslice_type is P, weightedPredFlag may be set to pps_weighted_pred_flag.Otherwise (when slice_type is B), weightedPredFlag may be set topps_weighted_bipred_flag.

Prediction samples as output of weighted prediction or the values of theprediction samples may be referred to as pbSamples.

Weighted prediction procedures may be largely divided into a defaultweighted (sample) prediction procedure and an explicit weighted (sample)prediction procedure. A weighted (sample) prediction procedure may referto only the explicit weighted (sample) prediction procedure. Forexample, when the value of weightedPredFlag is 0, the values ofprediction samples (pbSamples) may be derived based on the defaultweighted (sample) prediction procedure. When the value ofweightedPredFlag is 1, the values of prediction samples (pbSamples) maybe derived based on the explicit weighted (sample) prediction procedure.

When bi-prediction is applied to a current block, prediction samples maybe derived based on a weighted average. Conventionally, a bi-predictionsignal (i.e., bi-prediction samples) may be derived through simpleaveraging of an L0 prediction signal (L0 prediction samples) and an L1prediction signal (L1 prediction samples). That is, the bi-predictionsamples are derived as the average of the L0 prediction samples based onan L0 reference picture and MVLO and the L1 prediction samples based onan L1 reference picture and MVL1. However, according to the presentdocument, when bi-prediction is applied, a bi-prediction signal(bi-prediction samples) may be derived through weighted averaging of theL0 prediction signal and the L1 prediction signal.

Bi-directional optical flow (BDOF) may be used to refine a bi-predictionsignal. BDOF is for generating prediction samples by calculatingimproved motion information when bi-prediction is applied to a currentblock (e.g., a CU), and the process of calculating the improved motioninformation may be included in the motion information derivationoperation.

For example, BDOF may be applied in a 4×4 subblock level. That is, BDOFmay be performed in units of 4×4 subblocks in the current block. BDOFmay be applied only to a luma component. Alternatively, BDOF may beapplied only to a chroma component, or may be applied to a lumacomponent and a chroma component.

As described above, a high-level syntax (HLS) may be coded/signaled forvideo/image coding. Video/image information may be included in the HLS.

A coded picture may include one or more slices. A parameter describingthe coded picture is signaled in a picture header, and a parameterdescribing a slice is signaled in a slice header. The picture header iscarried in the form of an independent NAL unit. The slice header existsat the beginning of a NAL unit including a payload of the slice (i.e.,slice data).

Each picture is associated with a picture header. A picture may includedifferent types of slices (intra-coded slices (i.e., I slices) andinter-coded slices (i.e., P slices and B slices)). Accordingly, apicture header may include syntax elements necessary for an intra sliceof a picture and an inter slice of the picture.

A picture may be partitioned into subpictures, tiles, and/or slices.Subpicture signaling may exist in a sequence parameter set (SPS), andtile and square slice signaling may exist in a picture parameter set(PPS). Raster scan slice signaling may exist in a slice header.

When weighted prediction is applied for inter prediction of a currentblock, the weighted prediction may be performed based on information onthe weighted prediction.

A weighted prediction procedure may start based on two flags in an SPS.

For example, syntax elements shown below in Table 1 may be included inan SPS syntax with respect to the weighted prediction.

TABLE 1 Descriptor seq_parameter_set_rbsp( ) { sps_decoding_parameter_set_id u(4) ...  sps_weighted_pred_flag u(1) sps_weighted_bipred_flag u(1) ... }

In Table 1, the value of sps_weighted_pred_flag equal to 1 may indicatethat weighted prediction is applied to P slices referring to the SPS.

The value of sps_weighted_bipred_flag equal to 1 may indicate thatweighted prediction is applied to B slices referring to the SPS. Thevalue of sps_weighted_bipred_flag equal to 0 may indicate that weightedprediction is not applied to B slices referring to the SPS.

The two flags signaled in the SPS indicate whether weighted predictionis applied to P and B slices in a coded video sequence (CVS).

Syntax elements shown below in Table 2 may be included in a PPS syntaxwith respect to the weighted prediction.

TABLE 2 Descriptor pic_parameter_set_rbsp( ) {  pps_pic_parameter_set_idue(v) ...  pps_weighted_pred_flag u(1)  pps_weighted_bipred_flag u(1)...

In Table 2, the value of pps_weighted_pred_flag equal to 0 may indicatethat weighted prediction is not applied to P slices referring to thePPS. The value of pps_weighted_pred_flag equal to 1 may indicate thatweighted prediction is applied to the P slices referring to the PPS.When the value of sps_weighted_pred_flag is 0, the value ofpps_weighted_pred_flag is 0.

The value of pps_weighted_bipred_flag equal to 0 may indicate thatweighted prediction is not applied to B slices referring to the PPS. Thevalue of pps_weighted_bipred_flag equal to 1 may indicate that explicitweighted prediction is applied to the B slices referring to the PPS.When the value of sps_weighted_bipred_flag is 0, the value ofpps_weighted_bipred_flag is 0.

Additionally, syntax elements shown below in Table 3 may be included ina slice header syntax.

TABLE 3 Descriptor slice_header( ) {  slice_pic_parameter_set_id ue(v)...  if( ( nal_unit_type != IDR_W_RADL && nal_unit_type != IDR_N_LP ) ||    sps_idr_rpl_present_flag ) {   for( i = 0; i < 2; i++ ) {    if(num_ref_pic_lists_in_sps[ i ] > 0 && !pps_ref_pic_list_sps_idc[ i ] &&        ( i == 0 | | ( i == 1 && rpl1_idx_present_flag ) ) )    ref_pic_list_sps_flag[ i ]    if( ref_pic_list_sps_flag[ i ] ) {    if( num_ref_pic_lists_in_sps[ i ] > 1 &&        ( i == 0 | | (i == 1 && rpl1_idx_present_flag ) ) )       ref_pic_list_idx[ i ]    }else     ref_pic_list_(——)struct( i, num_ref_lists_in_sps[ i ] )    for(j = 0; j < NumLtrpEntries[ i ][ RplsIdx[ i ] ]; j++ ) {     if(ltrp_in_slice_header_flag[ i ][ RplsIdx[ i ] ] )      slice_poc_lsb_lt[i ][ j ]     delta_poc_msb_present_flag[ i ][ j ]     if(delta_poc_msb_present_flag[ i ][ j ] )      delta_poc_msb_cycle_lt[ i ][j ]    }   }   if( ( slice_type != 1 && num_ref_entries[ 0 ][ RplsIdx[ 0] ] > 1 ) | |    ( slice_type == B && num_ref_entries[ 1 ][ RplsIdx[ 1 ]] > 1 ) ) {    num_ref_idx_active_override_flag    if(num_ref_idx_active_override_flag )     for( i = 0; i < ( slice_type == B? 2; 1 ); i++ )      if( num_ref_entries[ i ][ RplsIdx[ i ] ] > 1 )      num_ref_idx_active_minus1[ i ]   }  } ...   if( (pps_weighted_pred_flag && slice_type == P ) | |    (pps_weighted_bipred_flag && slice_type == B ) )    pred_weighted_table() ... }

In Table 3, slice_pic_parameter_set_id indicates the value ofpps_pic_parameter_set_id for a PPS being used. The value ofslice_pic_parameter_set_id is included in a range from 0 to 63.

The value of a temporary ID (TempralID) of the current picture needs tobe greater than or equal to the value of TempralID of the PPS havingpps_pic_parameter_set_id that is the same as slice_pic_parameter_set_id.

A prediction weighted table syntax may include information on weightedprediction shown below in Table 4.

TABLE 4 Descriptor pred_weight_table( ) {  luma_log2_weight_denom ue(v) if( ChromaArrayType != 0 )   delta_chroma_log2_weight_denom se(v)  for(i = 0; i < NumRefIdxActive[ 0 ]; i++ )   luma_weight_l0_flag[ i ] u(1) if( ChromaArrayType != 0 )   for( i = 0; i < NumRefIdxActive[ 0 ]; i++)    chroma_weight_l0_flag[ i ] u(1)  for( i = 0; i < NumRefIdxActive[ 0]; i++ ) {   if( luma_weight_l0_flag[ i ] ) {    delta_luma_weight_l0[ i] se(v)    luma_offset_l0[ i ] se(v)   }   if( chroma_weight_l0_flag[ i] )    for( j = 0; j < 2; j++) {     delta_chroma_weight_l0[ i ][ j ]se(v)     delta_chroma_offset_l0[ i ][ j ] se(v)    }  }  if(slice_type == B ) {   for( i = 0; i < NumRefIdxActive[ 1 ]; i++ )   luma_weight_l1_flag[ i ] u(1)   if( ChromaArrayType != 0 )    for( i= 0; i < NumRefIdxActive[ 1 ]; i++ )     chroma_weight_l1_flag[ i ] u(1)  for( i = 0; i < NumRefIdxActive[ 1 ]; i++ ) {    if(luma_weight_l1_flag[ i ] ) {     delta_luma_weight_l1[ i ] se(v)    luma_offset_l1[ i ] se(v)    }    if( chroma_weight_l1_flag[ i ] )    for( j = 0; j < 2; j++ ) {      delta_chroma_weight_l1[ i ][ j ]se(v)      delta_chroma_offset_l1[ i ][ j ] se(v)     }   }  } }

In Table 4, luma_log2_weight_denom is the base-2 logarithm of adenominator for all luma weighting factors. The value ofluma_log2_weight_denom is included in a range from 0 to 7.

delta_chroma_log2_weight_denom is the difference in the base-2 logarithmof a denominator for all chroma weighting factors. Whendelta_chroma_log2_weight_denom does not exist,delta_chroma_log2_weight_denom is inferred as 0.

ChromaLog2WeightDenom is derived asluma_log2_weight_denom+delta_chroma_log2_weight_denom, and the valuethereof is included in a range from 0 to 7.

The value of luma_weight_10_flag[i] equal to 1 indicates that there areweighting factors for a luma component of (reference picture) list 0(L0) prediction using RefPicList[0] [i]. The value ofluma_weight_10_flag[i] equal to 0 indicates that these weighting factorsdo not exist.

The value of chroma_weight_10_flag[i] equal to 1 indicates that thereare weighting factors for chroma prediction values of L0 predictionusing RefPicList[0][i]. The value of chroma_weight_10_flag[i] equal to 0indicates that these weighting factors do not exist. Whenchroma_weight_10_flag[i] does not exist, chroma_weight_10_flag[i] isinferred as 0.

delta_luma_weight_10[i] is the difference in weighting factor applied toa luma prediction value for L0 prediction using RefPicList[0][i].

LumaWeightL0[i] is derived as (1<<luma_log2_weight_denom)+delta_luma_weight_10[i]. When luma_weight_10_flag[i] is1, the value of delta_luma_weight_10[i] is included in a range from −128to 127. When luma_weight_10_flag[i] is 0, LumaWeightL0[i] is inferred as2luma_log 2_weight_denom.

luma_offset_10[i] is an additive offset applied to a luma predictionvalue for L0 prediction using RefPicList[0][i]. The value ofluma_offset_10[i] is included in a range from −128 to 127. When thevalue of luma_weight_10_flag[i] is 0, the value of luma_offset_10[i] isinferred as 0.

delta_chroma_weight_10[i][j] is the difference in weighting factorapplied to a chroma prediction values for LO prediction usingRefPicList[0][i] where j is 0 for Cb and j is 1 for Cr.

ChromaWeightLO[i][j] is derived as (1 <<Chroma Log2WeightDenom)+delta_chroma_weight_10[i][j]. Whenchroma_weight_10_flag[i] is 1, the value of delta_chroma_weight_10[i][j]is included in a range from −128 to 127. When chroma_weight_10_flag[i]is 0, ChromaWeightLO[i][j] is inferred as 2ChromaLog2WeightDenom.

delta_chroma_offset_10[i][j] is the difference in additive offsetapplied to the chroma prediction value for L0 prediction usingRefPicList[0][i] where j is 0 for Cb and j is 1 for Cr.

The value of delta_chroma_offset_10[i][j] is included in a range from−4×128 to 4×127. When the value of chroma_weight_10_flag[i] is 0, thevalue of ChromaOffsetL0[i][j] is inferred as 0.

The prediction weighted table syntax is frequently used to modify asequence when there is a scene change. An existing prediction weightedtable syntax is signaled in a slice header when a PPS flag for weightedprediction is enabled and a slice type is P, or when a PPS flag forweighted bi-prediction is enabled and a slice type is B. However, theremay be often cases where a prediction weighted table needs to beadjusted for one or a plurality of frames when there is a scene change.In general, when a PPS is shared for a plurality of frames, signalinginformation on weighted prediction for all frames referring to the PPSmay be unnecessary.

The following drawings are provided to describe specific examples of thepresent document. Since specific terms for devices or specific terms forsignals/messages illustrated in the drawings are provided forillustration, technical features of the present disclosure are notlimited to the specific terms used in the following drawings.

The present document provides the following methods to solve theforegoing problems. The methods may be applied independently or may beapplied in combination with each other.

1. A tool for weighted prediction (information on weighted prediction)may be applied in a picture level rather than in a slice level.Weighting values are applied to a specific reference picture of apicture, and are used for all slices of the picture.

2. A prediction weighted table syntax may be signaled in the picturelevel rather than in the slice level. To this end, the predictionweighted table syntax may be signaled in a picture header (PH) or apicture parameter set (PPS).

3. When weighted prediction is applied to a picture, all slices in thepicture may have the same active reference pictures. This includes theorder of active reference pictures in a reference picture list (RPL)(i.e., L0 for P slices and L0 and L1 for B slices).

4. Alternatively, when the above does not apply, the following mayapply.

a. Signaling of weighted prediction is independent of signaling of areference picture list. That is, in signaling of a prediction weightedtable, there is no assumption about the order of reference pictures inthe reference picture list.

b. There is no signaling of weighted prediction values for referencepictures in L0 and L1. For the reference pictures, the weighting valuesare provided directly.

c. Only one loop may be used rather than two loops to signal a weightingvalue for a reference picture. In each loop, a reference pictureassociated with a signaled weighting value is first identified.

d. Reference picture identification is based on a picture order count(POC) value.

e. For bit saving, a delta POC value between a reference picture and acurrent picture may be signaled rather than signaling the POC value ofthe reference picture.

5. In addition to item 4, to signal the delta POC value between thereference picture and the current picture, the following may be appliedso that an absolute delta POC value may be signaled as follows.

a. A first signaled delta POC is the delta between the POC of thereference picture and the POC of current picture.

b. The rest of signaled delta POCs (i.e., where i starts from 1) is thedelta between the POC of an ith reference picture and the POC of an(i-1)th reference picture.

6. Two flags in a PPS may be unified into a single control flag (e.g.,pps_weighted_pred_flag). The flag may be used to indicate that anadditional flag exists in a picture header.

a. The flag in the PH may be conditioned on the PPS flag, and when a NALunit type is not instantaneous decoding refresh (IDR), existence ofpred_weighted_table( )data (prediction weighted table syntax)) may befurther indicated.

7. Two flags (pps_weighted_pred_flag and pps_weighted_bipred_flag)signaled in a PPS may be unified into one flag. The one flag may use theexisting name of pps_weighted_pred_flag.

8. A flag may be signaled in a picture header to indicate whetherweighted prediction is applied to a picture associated with the pictureheader. The flag may be referred to as pic_weighted_pred_flag.

a. Existence of pic_weighted_pred_flag may be conditioned on the valueof pps_weighted_pred_flag. When the value of pps_weighted_pred_flag is0, pic_weighted_pred_flag does not exist, and the value thereof may beinferred as 0.

b. When the value of pic_weighted_pred_flag is 1, signaling ofpred_weighted_table( ) may exist in the picture header.

9. Alternatively, when weighted prediction is enabled (i.e., the valueof pps_weighted_pred_flag is 1 or the value of pps_weighted_bipred_flagis 1), information on the weighted prediction may still exist in a sliceheader, and the following may apply.

a. A new flag may be signaled to indicate whether the information on theweighted prediction exists in the slice header. The flag may be referredto as slice_weighted_pred_present_flag.

b. Existence of slice_weighted_pred_present_flag may be determinedaccording to a slice type and the values of pps_weighted_pred_flag andpps_weighted_bipred_flag.

In the present document, information on weighted prediction may includeinformation/syntax elements related to the weighted prediction describedin Table 1 to Table 4. Video/image information may include variouspieces of information for inter prediction, such as information onweighted prediction, residual information, and inter prediction modeinformation. The inter prediction mode information may includeinformation/syntax elements, such as information indicating whether amerge mode or an MVP mode is applicable to a current block and selectioninformation for selecting one of motion candidates in a motion candidatelist. For example, when the merge mode is applied to the current block,a merge candidate list is constructed based on neighboring blocks of thecurrent block, and one candidate for deriving motion information on thecurrent block may be selected/used (based on a merge index) from themerge candidate list. In another example, when the MVP mode is appliedto the current block, an mvp candidate list may be constructed based onneighboring blocks of the current block, and one candidate for derivingmotion information on the current block may be selected/used (based onan mvp flag) from the mvp candidate list.

In an embodiment, for weighted prediction in inter prediction, a PPS mayinclude syntax elements shown below in Table 5, and the semantics of thesyntax elements may be as shown below in Table 6.

TABLE 5 Descriptor pic_parameter_set_rbsp( ) {  pps_pic_parameter_set_idue(v) ...  pps_weighted_pred_flag u(1) ... }

TABLE 6 pps_weighted_pred_flag equal to 0 specifies that weightedprediction is not applied to P or B slices referring to the PPS.pps_weighted_pred_flag equal to 1 specifies that weighted prediction isapplied to P or B slices referring to the PPS. Whensps_weighted_pred_flag is equal to 0, the value ofpps_weighted_pred_flag shall be equal to 0.

Referring to Table 5 and Table 6, the value of pps_weighted_pred_flagequal to 0 may indicate that weighted prediction is not applied to P orB slices referring to the PPS. The value of pps_weighted_pred_flag equalto 1 may indicate that weighted prediction is applied to P or B slicesreferring to the PPS.

In addition, a picture header may include syntax elements shown below inTable 7, and the semantics of the syntax elements may be as shown belowin Table 8.

TABLE 7 Descriptor picture_header_rbsp( ) {  non_reference_picture_flag...  pic_rpl_present_flag u(1)  if( pic_rpl_present_flag ) {   for( i =0; i < 2; i++ ) {    if( num_ref_pic_lists_in_sps[ i ] >0 && !pps_ref_pic_list_sps_idc[ i ] &&       ( i == 0 | | (i == 1 && rpl1_idx_present_flag ) ) )     pic_rpl_sps_flag[ i ] u(1)   if( pic_rpl_sps_flag[ i ] ) {     if( num_ref_pic_lists_in_sps[ i ] >1 &&        ( i == 0 | | ( i == 1 && rpl1_idx_present_flag ) ) )     pic_rpl_idx[ i ] u(v)    } else     ref_pic_list_struct( i,num_ref_pic_lists_in_sps[ i ] )    for( j = 0; j < NumLtrpEntries[ i ][RplsIdx[ i ] ]; j++ ) {     if( ltrp_in_slice_header_flag[ i ][ RplsIdx[i ] ] )      pic_poc_lsb_lt[ i ][ j ] u(v)    pic_delta_poc_msb_present_flag[ i ][ j ] u(1)     if(pic_delta_poc_msb_present_flag[ i ][ j ] )     pic_delta_poc_msb_cycle_lt[ i ][ j ] ue(v)    }   }  } if(pps_weighted_pred_flag ) {  pic_weighted_pred_flag u(1)  if( (pic_weighted_pred_flag && ( nal_unit_type != IDR_W_RADL &&nal_unit_type != IDR_N_LP ) ) )   pred_weight_table( ) } ... }

pic_weighted_pred_flag equal to 0 specifies that weighted prediction isnot applied to P or B slices referring to the PH. pic_weighted_pred_flagequal to 1 specifies that weighted prediction is applied to P or Bslices referring to the PH. When not present, the value ofpic_weighted_pred_flag shall equal to 0.

Referring to Table 7 and Table 8, the value of pic_weighted_pred_flagequal to 0 may indicate that weighted prediction is not applied to P orB slices referring to the picture header. The value ofpic_weighted_pred_flag equal to 1 may indicate that weighted predictionis applied to P or B slices referring to the picture header.

When the value of pic_weighted_pred_flag is 1, all slices in the pictureassociated with the picture header may have the same reference picturelists. Otherwise, when the value of pic_weighted_pred_flag is 1, thevalue of pic_rpl_present_flag may be 1.

In the absence of the above condition, pic_weighted_pred_flag may besignaled as shown below in Table 9.

TABLE 9 Descriptor picture_header_rbsp( ) { ...  pic_rpl_present_flagu(1)  if( pic_rpl_present_flag ) {   ...  }  if(pps_weighted_pred_flag &&  pic_rpl_present_flag ) {  pic_weighted_pred_flag u(1)   if( ( pic_weighted_pred_flag &&   (nal_unit_type != IDR_W_RADL &&     nal_unit_type != IDR_N_LP ) ) )   pred_weight_table( )  } ... }

Meanwhile, a slice header may include syntax elements shown below inTable 10.

TABLE 10 Descriptor slice_header( ) {  slice_pic_parameter_set_id ue(v)...  if( ( nal_unit_type != IDR_W_RADL && nal_unit_type != IDR_N_LP ) ||    sps_idr_rpl_present_flag ) {   for( i = 0; i < 2; i++ ) {    if(num_ref_pic_lists_in_sps[ i ] > 0 && !pps_ref_pic_list_sps_idc[ i ] &&        ( i == 0 | | ( i == 1 && rpl1_idx_present_flag ) ) )    ref_pic_list_sps_flag[ i ]    if( ref_pic_list_sps_flag[ i ] ) {    if( num_ref_pic_lists_in_sps[ i ] > 1 &&        ( i == 0 | | (i == 1 && rpl1_idx_present_flag ) ) )       ref_pic_list_idx[ i ]    }else     ref_pic_list_struct( i, num_ref_pic_lists_in_sps[ i ] )    for(j = 0; j < NumLtrpEntries[ i ][ RplsIdx[ i ] ]; j++ ) {     if(ltrp_in_slice_header_flag[ i ][ RplsIdx[ i ] ] )      slice_poc_lsb_lt[i ][ j ]     delta_poc_msb_present_flag[ i ][ j ]     if(delta_poc_msb_present_flag[ i ][ j ] )      delta_poc_msb_cycle_lt[ i ][j ]    }   }   if( ( slice_type != I && num_ref_entries[ 0 ][ RplsIdx[ 0] ] > 1 ) | |    ( slice_type == B && num_ref_entries[ 1 ][ RplsIdx[ 1 ]] > 1 ) ) {    num_ref_idx_active_override_flag    if(num_ref_idx_active_override_flag )     for( i = 0; i < ( slice_type == B? 2: 1 ); i++ )      if( num_ref_entries[ i ][ RplsIdx[ i ] ] > 1 )      num_ref_idx_active_minus1[ i ]   }  } ... }

Further, a prediction weighted table syntax may include syntax elementsshown below in Table 11, and the semantics of the syntax elements may beas shown below in Table 12.

TABLE 11 Descriptor pred_weight_table( ) {  luma_log2_weight_denom ue(v) if( ChromaArrayType != 0 )   delta_chroma_log2_weight_denom se(v) num_l0_weighted_ref_pics ue(v)  for( i = 0; i <num_l0_weighted_ref_pics; i++ )   luma_weight_l0_flag[ i ]  if(ChromaArrayType != 0 )   for( i = 0; i < NumRefIdxActive[ 0 ]; i++ )   chroma_weight_l0_flag[ i ] u(1)  for( i = 0; i < NumRefIdxActive[ 0]; i++ ) {   if( luma_weight_l0_flag[ i ] ) {    delta_luma_weight_l0[ i] se(v)    luma_offset_l0[ i ] se(v)   }   if( chroma_weight_l0_flag[ i] )    for( j = 0; j < 2; i++ ) {     delta_chroma_weight_l0[ i ][ j ]se(v)     delta_chroma_offset_l0[ i ][ j ] se(v)    }  } num_l1_weighted_ref_pics ue(v)  for( i = 0; i <num_l1_weighted_ref_pics; i++ )   luma_weight_l1_flag[ i ] u(1)  if(ChromaArrayType != 0 )   for( i = 0; i < NumRefIdxActive[ 1 ]; i++ )   chroma_weight_l1_flag[ i ] u(1)  for( i = 0; i < NumRefIdxActive[ 1]; i++ ) {   if( luma_weight_l1_flag[ i ] ) {    delta_luma_weight_l1[ i] se(v)    luma_offset_l1[ i ] se(v)   }   if( chroma_weight_l1_flag[ i] )    for( j = 0; j < 2; j++ ) {     delta_chroma_weight_l1[ i ][ j ]se(v)     delta_chroma_offset_l1[ i ][ j ] se(v)    }  } }

TABLE 12 num_l0_weighted_ref_pics specifies the number of referencepictures in reference picture list 0 that are weighted. The value ofnum_l0_weighted_ref_pics shall ranges from 0 to MaxDecPicBuffMinus1 +14, inclusive. num_l1_weighted_ref_pics specifies the number ofreference pictures in reference picture list 1 that are weighted. Thevalue of num_l1_weighted_ref_pics shall ranges from 0 toMaxDecPicBuffMinus1 + 14, inclusive.

Referring to Table 11 and Table 12, num_10_weighted_ref pics mayindicate the number of weighted reference pictures in reference picturelist 0. The value of num_10_weighted_ref pics is included in a rangefrom 0 to MaxDecPicBuffMinus1+14.

num_11_weighted_ref pics may indicate the number of weighted referencepictures in reference picture list 1. The value ofnum_11_weighted_ref_pics is included in a range from 0 toMaxDecPicBuffMinus1+14.

The value of luma_weight_10_flag[i] equal to 1 indicates that there areweighting factors for a luma component of list 0 (L0) prediction usingRefPicList[0][i].

The value of chroma_weight_10_flag[i] equal to 1 indicates that thereare weighting factors for chroma prediction values of L0 predictionusing RefPicList[0][i]. The value of chroma_weight_10_flag[i] equal to 0indicates that these weighting factors do not exist.

The value of luma_weight_11_flag[i] equal to 1 indicates that there areweighting factors for a luma component of list 1 (L1) prediction usingRefPicList[0][i].

chroma_weight_11_flag[i] indicates that there are weighting factors forchroma prediction values of L1 prediction using RefPicList[0][i]. Thevalue of chroma_weight_10_flag[i] equal to 0 indicates that theseweighting factors do not exist.

For example, when weighted prediction is applied to the current block,the encoding apparatus may generate number information on weightedreference pictures in a reference picture list of the current blockbased on the weighted prediction. The number information may refer tonumber information on weightings signaled for items (reference pictures)in an L0 reference picture list and/or an L1 reference picture list.That is, the value of the number information may be equal to the numberof weighted reference pictures in the reference picture list (L0 and/orL1). Thus, when the value of the number information is n, the predictionweighted table syntax may include n weighting factor-related flags forthe reference picture list. The weighting factor-related flags maycorrespond to luma_weight_10_flag, luma_weight_ll_flag,chroma_weight_10_flag, and/or chroma_weight_10_flag of Table 11.Weightings for the current picture may be derived based on the weightingfactor-related flags.

When weighted bi-prediction is applied to the current block, theprediction weighted table syntax may independently include numberinformation on weighted reference pictures in the L1 reference picturelist and number information on weighted reference pictures in the L0reference picture list as shown in Table 11. The weightingfactor-related flags may be independently included for each of thenumber information on the weighted reference pictures in the L1reference picture list and the number information on the weightedreference pictures in the L0 reference picture list. That is, theprediction weighed table syntax may include the same number ofluma_weight_10_flag and/or chroma_weight_10_flag as the number ofweighted reference pictures in the LO reference picture list and mayinclude the same number of luma_weight_11_flags and/orchroma_weight_11_flags as the number of weighted reference pictures inthe L1 reference picture list.

The encoding apparatus may encode image information including the numberinformation and the weighting factor-related flags and may output theencoded image information in the form of a bitstream. Here, the numberinformation and the weighting factor-related flags may be included inthe prediction weighted table syntax in the image information as shownin Table 11. The prediction weighted table syntax may be included in apicture header in the image information or in a slice header in theimage information. To indicate whether the prediction weighted tablesyntax is included in the picture header, that is, to indicate whetherinformation on the weighted prediction exists in the picture header, aweighted prediction-related flag may be included in a picture parameterset and/or the picture header. When the weighted prediction-related flagis included in the picture parameter set, the weightedprediction-related flag may correspond to pps_weighted_pred_flag ofTable 5. When the weighted prediction-related flag is included in thepicture header, the weighted prediction-related flag may correspond topic_weighted_pred_flag of Table 7. Alternatively, bothpps_weighted_pred_flag and pic_weighted_pred_flag may be included in theimage information to indicate whether the prediction weighted tablesyntax is included in the picture header.

When the weighted prediction-related flag is parsed from the bitstream,the decoding apparatus may parse the prediction weighted table syntaxfrom the bitstream based on the parsed flag. The weightedprediction-related flag may be parsed from the picture parameter setand/or the picture header of the bitstream. In other words, the weightedprediction-related flag may include pps_weighted_pred_flag and/orpic_weighted_pred_flag. When the values of pps_weighted_pred_flag and/orpic_weighted_pred_flag are 1, the decoding apparatus may parse theprediction weighted table syntax from the picture header of thebitstream.

When the prediction weighted table syntax is parsed from the pictureheader (when the values of pps_weighted_pred_flag and/orpic_weighted_pred_flag are 1), the decoding apparatus may apply theinformation on the weighted prediction included in the predictionweighted table syntax to all slices in the current picture. In otherwords, when the prediction weighted table syntax is parsed from thepicture header, all slices in the picture associated with the pictureheader may have the same reference picture list.

The decoding apparatus may parse the number information on the weightedreference pictures in the reference picture list of the current blockbased on the prediction weighted table syntax. The value of the numberinformation may be equal to the number of weighted reference pictures inthe reference picture list. When weighted bi-prediction is applied tothe current block, the decoding apparatus may independently parse thenumber information on the weighted reference pictures in the L1reference picture list and the number information on the weightedreference pictures in the L0 reference picture list from the predictionweighted table syntax.

The decoding apparatus may parse the weighting factor-related flags forthe reference picture list from the prediction weighted table syntaxbased on the number information. The weighting factor-related flags maycorrespond to luma_weight_10_flag, luma_weight_11_flag,chroma_weight_10_flag, and/or chroma_weight_10_flag of Table 11. Forexample, when the value of the number information is n, the decodingapparatus may parse n weighting factor-related flags from the predictionweighted table syntax. The decoding apparatus may derive weightings forthe reference pictures of the current block based on the weightingfactor-related flags, and may perform weighted prediction on the currentblock based on the weightings, thereby generating or deriving predictionsamples. Subsequently, the decoding apparatus may generate or derivereconstructed samples for the current block based on the predictionsamples, and may reconstruct the current picture based on thereconstructed samples.

In another embodiment, for weighted prediction in inter prediction, apicture header may include syntax elements shown below in Table 13, andthe semantics of the syntax elements may be as shown below in Table 14.

TABLE 13 Descriptor picture_header_rbsp( ) {  non_reference_picture_flagu(1) ...  pic_weighted_pred_flag u(1)  pic_rpl_present_flag u(1)  if(pic_rpl_present_flag ) {   for( i = 0; i < 2; i++ ) {    if(num_ref_pic_lists_in_sps[ i ] > 0 && !pps_ref_pic_list_sps_idc[ i ] &&      ( i == 0 | | ( i == 1 && rpl1_idx_present_flag ) ) )    pic_rpl_sps_flag[ i ] u(1)    if( pic_rpl_sps_flag[ i ] ) {     if(num_ref_pic_lists_in_sps[ i ] > 1 &&        ( i == 0 | | (i == 1 && rpl1_idx_present_flag ) ) )      pic_rpl_idx[ i ] u(v)    }else     ref_pic_list_struct( i, num_ref_pic_lists_in_sps[ i ] )    for(j = 0; j < NumLtrpEntries[ i ][ RplsIdx[ i ]; j++ ) {     if(ltrp_in_slice_header_flag[ i ][ RplsIdx[ i ] ] )      pic_poc_lsb_lt[ i][ j ] u(v)     pic_delta_poc_msb_present_flag[ i ][ j ] u(1)     if(pic_delta_poc_msb_present_flag[ i ][ j ] )     pic_delta_poc_msb_cycle_lt[ i ][ j ] ue(v)   if( (pic_weighted_pred_flag && ( nal_unit_type != IDR_W_RADL &&nal_unit_type != IDR_N_LP ) ) )    pred_weight_table( )    }   }  } ...}

TABLE 14 pic_weighted_pred_flag equal to 0 specifies that weightedprediction is not applied to P or B slices referring to the PH.pic_weighted_pred_flag equal to 1 specifies that weighted prediction isapplied to P or B slices referring to the PH. Whensps_weighted_pred_flag is equal to 0, the value ofpic_weighted_pred_flag shall be equal to 0. NOTE- It is constraint thatall slices have the same RPL if the pred_weighted_table( ) is present inthe PH.

Referring to Table 13 and Table 14, when the value ofpic_weighted_pred_flag equal to 0 may indicate that weighted predictionis not applied to P or B slices referring to the picture header. Thevalue of pic_weighted_pred_flag equal to 1 may indicate that weightedprediction is applied to P or B slices referring to the picture header.When the value of sps_weighted_pred_flag is 0, the value ofpic_weighted_pred_flag is 0.

A slice header may include syntax elements shown below in Table 15.

TABLE 15 Descriptor slice_header( ) {  slice_pic_order_cnt_lsb u(v) ... if( !pic_rpl_present_flag &&( ( nal_unit_type != IDR_W_RADL &&nal_unit_type !=        IDR_N_LP ) | | sps_idr_rpl_present_flag ) ) {  for( i = 0; i < 2; i++ ) {    if( num_ref_pic_lists_in_sps[ i ] >0 && !pps_ref_pic_list_sps_idc[ i ] &&          ( i == 0 | | (i == 1 && rpl1_idx_present_flag ) ) )     slice_rpl_sps_flag[ i ] u(1)   if( slice_rpl_sps_flag[ i ] ) {     if( num_ref_pic_lists_in_sps[ i] > 1 &&         ( i == 0 | | ( i == 1 && rpl1_idx_present_flag ) ) )      slice_rpl_idx[ i ] u(v)    } else     ref_pic_list_struct( i,num_ref_pic_lists_in_sps[ i ] )    for( j = 0; j < NumLtrpEntries[ i ][RplsIdx[ i ] ]; j++ ) {     if( ltrp_in_slice_header_flag[ i ][ RplsIdx[i ] ] )      slice_poc_lsb_lt[ i ][ j ] u(v)    slice_delta_poc_msb_present_flag[ i ][ j ] u(1)     if(slice_delta_poc_msb_present_flag[ i ][ j ] )     slice_delta_poc_msb_cycle_lt[ i ][ j ] ue(v)    }   }  }  if(pic_rpl_present_flag | | ( ( nal_unit_type != IDR_W_RADL &&nal_unit_type !=     IDR_N_LP ) | | sps_idr_rpl_present_flag ) ) {   if(( slice_type != I && num_ref_entries[ 0 ][ RplsIdx[ 0 ] ] > 1 ) | |    (slice_type == B && num_ref entries[ 1 ][ RplsIdx[ 1 ] ] > 1 ) ) {   num_ref_idx_active_override_flag u(1)    if(num_ref_idx_active_override_flag )     for( i = 0; i < ( slice_type == B? 2: 1 ); i++ )      if( num_ref_entries[ i ][ RplsIdx[ i ] ] > 1 )      num_ref_idx_active_minus1[ i ] ue(v)   }  }  if( slice_type != I ){   if( cabac_init_present_flag )    cabac_init_flag u(1)   if(pic_temporal_mvp_enabled_flag ) {    if( slice_type == B &&!pps_collocated_from_l0_idc )     collocated_from_l0_flag u(1)    if( (collocated_from_l0_flag && NumRefIdxActive[ 0 ] > 1 ) | |     (!collocated_from_l0_flag && NumRefIdxActive[ 1 ] > 1 ) )    collocated_ref_idx ue(v)   }   if( (!pic_weighted_pred_flag&& slice_type == P ) | |    (pps_weighted_bipred_flag && slice_type == B ) )    pred_weight_table( ) }

Referring to Table 15, the weighted prediction-related flag(pic_weighted_pred_flag) may indicate whether the prediction weightedtable syntax (information on the weighted prediction) exists in thepicture header or the slice header. The value of pic_weighted_pred_flagequal to 1 may indicate that the prediction weighted table syntax(information on the weighted prediction) may exist in the picture headerrather than in the slice header. The value of pic_weighted_pred_flagequal to 0 may indicate that the prediction weighted table syntax(information on the weighted prediction) may exist in the slice headerrather than in the picture header. Although Table 13 and Table 14 showthat the weighted prediction-related flag is signaled in the pictureheader, the weighted prediction-related flag may be signaled in thepicture parameter set.

For example, when weighted prediction is applied to the current block,the encoding apparatus performs the weighted prediction and may encodeimage information including a weighted prediction-related flag and aprediction weighted table syntax based on the weighted prediction. Here,the encoding apparatus may determine the value of the flag as 1 when theprediction weighted table syntax is included in the picture header ofthe image information, and may determine the value of the flag as 0 whenthe prediction weighted table syntax is included in the slice header ofthe image information. When the value of the flag is 1, information onthe weighted prediction included in the prediction weighted table syntaxmay be applied to all slices in the current picture. When the value ofthe flag is 0, the information on the weighted prediction included inthe prediction weighted table syntax may be applied to a slice(s)associated with the slice header among the slices in the currentpicture. Accordingly, when the prediction weighted table syntax isincluded in the picture header, all slices in the picture associatedwith the picture header may have the same reference picture list, andwhen the prediction weighted table syntax is included in the sliceheader, the slices associated with the slice header may have the samereference picture list.

The prediction weighted table syntax may include number information onweighted reference pictures in a reference picture list of the currentblock, a weighting factor-related flag, and the like. As describedabove, the number information may refer to number information onweightings signaled for items (reference pictures) in an L0 referencepicture list and/or an L1 reference picture list, and the value of thenumber information may be equal to the number of weighted referencepictures in the reference picture list (L0 and/or L1). Thus, when thevalue of the number information is n, the prediction weighted tablesyntax may include n weighting factor-related flags for the referencepicture list. The weighting factor-related flags may correspond toluma_weight_10_flag, luma_weight_11_flag, chroma_weight_10_flag, and/orchroma_weight_10_flag of Table 11.

When weighted bi-prediction is applied to the current block, theencoding apparatus may generate a prediction weighted table syntaxincluding number information on weighted reference pictures in the L1reference picture list and number information on weighted referencepictures in the L0 reference picture list. The prediction weighted tablesyntax may include weighting factor-related flags independently for eachof the number information on the weighted reference pictures in the L1reference picture list and the number information on the weightedreference pictures in the L0 reference picture list. That is, theprediction weighed table syntax may include the same number ofluma_weight_10_flag and/or chroma_weight_10_flag as the number ofweighted reference pictures in the L0 reference picture list and mayinclude the same number of luma_weight_11_flags and/orchroma_weight_11_flags as the number of weighted reference pictures inthe L1 reference picture list.

When the weighted prediction-related flag is parsed from the bitstream,the decoding apparatus may parse the prediction weighted table syntaxfrom the bitstream based on the parsed flag. The weightedprediction-related flag may be parsed from the picture parameter setand/or the picture header of the bitstream. In other words, the weightedprediction-related flag may correspond to pps_weighted_pred_flag and/orpic_weighted_pred_flag. When the value of the weightedprediction-related flag is 1, the decoding apparatus may parse theprediction weighted table syntax from the picture header of thebitstream. When the value of the weighted prediction-related flag is 0,the decoding apparatus may parse the prediction weighted table syntaxfrom the slice header of the bitstream.

When the prediction weighted table syntax is parsed from the pictureheader, the decoding apparatus may apply the information on the weightedprediction included in the prediction weighted table syntax to allslices in the current picture. In other words, when the predictionweighted table syntax is parsed from the picture header, all slices inthe picture associated with the picture header may have the samereference picture list. When the prediction weighted table syntax isparsed from the slice header, the decoding apparatus may apply theinformation on the weighted prediction included in the predictionweighted table syntax to a slice(s) associated with the slice headeramong the slices in the current picture. In other words, when theprediction weighted table syntax is parsed from the picture header, theslices associated with the slice header may have the same referencepicture list.

The decoding apparatus may parse the number information on the weightedreference pictures in the reference picture list of the current blockbased on the prediction weighted table syntax. The value of the numberinformation may be equal to the number of weighted reference pictures inthe reference picture list. When weighted bi-prediction is applied tothe current block, the decoding apparatus may independently parse thenumber information on the weighted reference pictures in the L1reference picture list and the number information on the weightedreference pictures in the L0 reference picture list from the predictionweighted table syntax.

The decoding apparatus may parse the weighting factor-related flags forthe reference picture list from the prediction weighted table syntaxbased on the number information. The weighting factor-related flags maycorrespond to luma_weight_10_flag, luma_weight_11_flag,chroma_weight_10_flag, and/or chroma_weight_10_flag described above. Forexample, when the value of the number information is n, the decodingapparatus may parse n weighting factor-related flags from the predictionweighted table syntax. The decoding apparatus may derive weightings forthe reference pictures of the current block based on the weightingfactor-related flags, and may perform inter prediction on the currentblock based on the weightings, thereby generating or deriving predictionsamples. The decoding apparatus may generate or derive reconstructedsamples for the current block based on the prediction samples, and maygenerate a reconstructed picture for the current picture based on thereconstructed samples.

In still another embodiment, a prediction weighted table syntax mayinclude syntax elements shown below in Table 16, and the semantics ofthe syntax elements may be as shown below in Table 17.

TABLE 16 Descriptor pred_weight_table( ) {  luma_log2_weight_denom ue(v) if( ChromaArrayType != 0 )   delta_chroma_log2_weight_denom se(v) num_weighted_ref_pics_minus1  for( i = 0; i <= num_weighted_ref_pics_minus1; i++ )   pic_poc_abs_delta[ i ] ue(v)  if( pic_poc_abs_delta[ i ] )    pic_poc_delta_sign[ i ] u(1)  luma_weight_flag[ i ] u(1)  if( ChromaArrayType != 0 )   for( i =0; <=   num_weighted_ref_pics_minus1; i++ )    chroma_weight_flag[ i ]u(1)  for( i = 0; i <=  num_weighted_ref_pics_minus1; i++ ) {   if(luma_weight_flag[ i ] ) {    delta_luma_weight[ i ] se(v)   luma_offset[ i ] se(v)   }   if( chroma_weight_flag[ i ] )    for( j= 0; j < 2; j++ ) {     delta_chroma_weight[ i ][ j ] se(v)    delta_chroma_offset[ i ][ j ] se(v)    }  } }

TABLE 17 luma_log2_weight_denom is the base 2 logarithm of thedenominator for all luma weighting factors. The value ofluma_log2_weight_denom shall be in the range of 0 to 7, inclusive.delta_chroma_log2_weight_denom is the difference of the base 2 logarithmof the denominator for all chroma weighting factors. Whendelta_chroma_log2_weight_denom is not present, it is inferred to beequal to 0. The variable ChromaLog2WeightDenom is derived to be equal toluma_log2_weight_denom + delta_chroma_log2_weight_denom and the valueshall be in the range of 0 to 7, inclusive. num_weighted_ref_pics_minus1plus 1 specifies the number of reference pictures in reference picturesthat are weighted. The value of num_weighted_ref_pics shall ranges from0 to MaxDecPicBuffMinus1 + 14, inclusive. It is a conformance constraintthat the value of num_weighted_ref_pics_minus1 plus 1 shall not be lessthan the sum of unique active reference pictures in the referencepicture lists L0 and L1 of all slices of pictures associated with thepicture header containing the weighted prediction table.pic_poc_abs_delta[ i ] specifies the absolute POC difference between thecurrent picture and the i-th weighted reference picture.pic_poc_delta_sign[ i ] specifies the sign of POC difference between thecurrent picture and the i-th weighted reference picture. Ifpic_poc_delta_sign[ i ] is equal to 0, the correspondingpic_poc_abs_delta[ i ] has a positive value, otherwise, thecorresponding pic_poc_abs_delta[ i ] has a negative value.luma_weight_flag[ i ] equal to 1 specifies that weighting factors forthe luma component in the reference picture associated withDeltaPocWeightedRefPic[ i ] are present. luma_weight_flag[ i ] equal to0 specifies that these weighting factors are not present.chroma_weight_flag[ i ] equal to 1 specifies that weighting factors forthe chroma component in the reference picture associated withDeltaPocWeightedRefPic[ i ] are present. chroma_weight_flag[ i ] equalto 0 specifies that these weighting factors are not present. Whenchroma_weight_flag[ i ] is not present, it is inferred to be equal to 0.delta_luma_weight[ i ] is the difference of the weighting factor appliedto the luma prediction value for in the reference picture associatedwith DeltaPocWeightedRefPic[ i ]. luma_offset[ i ] is the additiveoffset applied to the luma prediction value for in the reference pictureassociated with DeltaPocWeightedRefPic[ i ] list 0 prediction usingRefPicList[ 0 ][ i ]. The value of luma_offset_l0[ i ] shall be in therange of −128 to 127, inclusive. When luma_weight_flag[ i ] is equal to0, luma_offset[ i ] is inferred to be equal to 0.delta_chroma_weight_l0[ i ][ j ] is the difference of the weightingfactor applied to the chroma prediction values for in the referencepicture associated with DeltaPocWeightedRefPic[ i ] with j equal to 0for Cb and j equal to 1 for Cr. delta_chroma_offset[ i ][ j ] is thedifference of the additive offset applied to the chroma predictionvalues for in the reference picture associated withDeltaPocWeightedRefPic[ i ] with j equal to 0 for Cb and j equal to 1for Cr.

In Table 16 and Table 17, when pic_poc_delta_sign[i] does not exist,pic_poc_delta_sign[i] is inferred as 0. DeltaPocWeightedRefPic[i] wherei is included in a range from 0 to num_weighted_ref_pics_minus1 may bederived as follows.

DeltaPocWeightedRefPic[i]=pic_poc_abs_delta[i]*(1-2*pic_poc_deltasign[i])  [Equation1]

ChromaWeight[i][j] may be derived as(1<<ChromaLog2WeightDenom)+delta_chroma_weight [i][j]. When the value ofchroma_weight_flag[i] is 1, the value of delta_chroma_weight[i][j] isincluded in a range from −128 to 127. When the value ofchroma_weight_flag[i] is 0, ChromaWeight[i][j] may be derived as2ChromaLog2WeightDenom.

ChromaOffset[i][j] may be derived as follows.

ChromaOffset[i][j]=Clip3(−128, 127, (128+delta aromaoffset[i][j]−((128*ChromaWeight[i][j])>>ChromaLog2WeightDenom))  [Equation2]

The value of delta_chroma_offset[i][j] is included in a range from−4*128 to 4*127. When the value of chroma_weight_flag[i] is 0, the valueof ChromaOffset[i][j] is inferred as 9.

sumWeightFlags may be derived as the sum of luma_weight_flag [i]+2*chroma_weight_flag [i]. i is included in a range from 0 tonum_weighted_ref_pics_minus1. When slice_type is P, sumWeightL0Flags isless than or equal to 24.

When a current slice is a P slice or a B slice and the value ofpic_weighted_pred_flag is 1, LOToWeightedRefidx[i] may represent mappingbetween an index in a list of weighted reference pictures and an ithreference picture L0. i is included in a range from 0 toNumRefidxActive[0]−1, and may be derived as follows.

[Equation 3] for( i = 0; i < NumRefIdxActive[ 0 ]; i++ ) { L0ToWeightedRefIdx[ i ] =−1  for( j = 0; L0ToWeightedRefIdx[ i ] ==−1 && j <= num_weighted_ref_pic_minus1; j++ )   if( RefPicPocList[ 0 ][i ] == PicOrderCntVal − DeltaPocWeightedRefPic[ j ] )   L0ToWeightedRefIdx[ i ] = j }

When the current slice is a B slice and the value ofpic_weighted_pred_flag is 1, L1ToWeightedRefidx[i] may represent mappingbetween an index in the list of weighted reference pictures and an ithactive reference picture L1. i is included in a range from 0 toNumRefidxActive[1]−1, and may be derived as follows.

[Equation 4] for( i = 0; i < NumRefIdxActive[ 1 ]; i++ ) { L1ToWeightedRefIdx[ i ] =−1  for( j = 0; L1ToWeightedRefIdx[ i ] ==−1 && j <= num_weighted_ref_pics_minus1; j++ )   if( RefPicPocList[ 1 ][i ] == PicOrderCntVal − DeltaPocWeightedRefPic[ j ] )   L1ToWeightedRefIdx[ i ] = j }

When luma_weight_10_flag[i] occurs, luma_weight_10_flag[i] is replacedwith luma_weight_flag[LOToWeightedRefidx[i]], and whenluma_weight_11_flag [i] occurs, luma_weight_11_flag [i] is replaced withluma_weight_flag [L1ToWeightedRefidx[i]].

When LumaWeightL0 [i] occurs, LumaWeightL0 [i] is replaced withLumaWeight[L0ToWeightedRefidx[i]], and when LumaWeightL1[i] occurs,LumaWeightL1[i] is replaced with LumaWeight [L1ToWeightedRefidx[i]].

When luma_offset_10[i] occurs, luma_offset_10[i] is replaced withluma_offset[LOToWeightedRefidx[i]l, and when luma_offset_11[i] occurs,luma_offset_11[i] is replaced with luma_offset[L1ToWeightedRefidx [i]].

When ChromaWeightL0[i] occurs, ChromaWeightL0[i] is replaced withChromaWeight [LOToWeightedRefIdx[i]], and when ChromaWeightL1[i] occurs,ChromaWeightL1[i] is replaced with ChromaWeight[L1ToWeightedRefIdx[i]].

In yet another embodiment, a slice header syntax may include syntaxelements shown below in Table 18, and the semantics of the syntaxelements may be as shown below in Table 19.

TABLE 18 Descriptor slice_header( ) {  ...   if( (pps_weighted_pred_flag && slice_type == P ) | |    (pps_weighted_bipred_flag && slice_type == B ) )   slice_weight_pred_present_flag u(1)    if(slice_weight_pred_present_flag )     pred_weight_table( )  }  ... }

TABLE 19 slice_weight_pred_present_flag equal to 1 specifies that weightprediction table is present in the slice header.slice_weight_pred_present_flag equal to 0 specifies that weightprediction table is not present in the slice header.

Referring to Table 18 and Table 19, a flag indicating whether aprediction weighted table syntax exists in a slice header may besignaled. The flag may be signaled in the slice header and may bereferred to as slice_weight_pred_present_flag.

The value of slice_weight_pred_present_flag equal to 1 may indicate thatthe prediction weighted table syntax exists in the slice header. Thevalue of slice_weight_pred_present_flag equal to 0 may indicate that theprediction weighted table syntax does not exist in the slice header.That is, slice_weight_pred_present_flag equal to 0 may indicate that theprediction weighted table syntax exists in a picture header.

In still another embodiment, a prediction weighted table syntax isparsed from a slice header, but an adaptation parameter set includingsyntax elements shown below in Table 20 may be signaled.

TABLE 20 Descriptor adaptation_parameter_set_rbsp( ) { adaptation_parameter_set_id u(5)  aps_params_type u(3)  if(aps_params_type == ALF_APS )   alf_data( )  else if(aps_params_type == LMCS_APS )   lmcs_data( )  else if(aps_params_type == SCALING_APS )   scaling_list_data( )   else if(aps_params_type == PRED_WEIGHT_APS )     pred_weight_data( ) aps_extension_flag u(1)  if( aps_extension_flag )   while(more_rbsp_data( ) )    aps_extension_data_flag u(1)  rbsp_trailing_bits() }

Each APS RBSP needs to be available for a decoding process before beingincluded for reference in at least one access unit having Temporand lessthan or equal to TemporalId of a coded slice NAL unit that refers to theAPS RBSP or is provided through a external method.

aspLayerId may be referred to as nuh_layer_id of an APS NAL unit. When alayer with nuh_layer_id equal to aspLayerld is an independent layer(i.e., when vps_independent_layer_flag[GeneralLayerIdx[aspLayerId]] is1), an APS NAL unit including an APS RBSP has the same nuh_layer_id asnuh_layer_id of a coded slice NAL unit referring to the APS RBSP.Otherwise, the APS NAL unit including the APS RBSP has the samenuh_layer_id as nuh_layer_id of the coded slice NAL unit referring tothe APS RBSP or nuh_layer_id of a direct dependent layer of a layerincluding the coded slice NAL unit referring to the APS RBSP.

All APS NAL units having a specific value of adaptation_parameter_set_idand a specific value of aps_params_type in an access unit have the samecontent.

adaptation_parameter_set_id provides an identifier for the APS so thatother syntax elements may refer to the identifier.

When aps_params_type is ALF_APS, SCALING_APS, or PRED_WEIGHT_APS, thevalue of adaptation_parameter_set_id is included in a range from 0 to 7.

When aps_params_type is LMCS_APS, the value ofadaptation_parameter_set_id is included in a range from 0 to 3.

aps_params_type indicates the type of APS parameters included in the APSas shown below in Table 21. When the value of aps_params_type is 1(LMCS_APS), the value of adaptation_parameter_set_id is included in arange from 0 to 3.

TABLE 21 Name of Type of APS aps_params_type aps_params_type parameters0 ALF_APS ALF parameters 1 LMCS_APS LMCS parameters 2 SCALING_APSScaling list parameters 3 PRED_WEIGHT_APS Prediction weighted parameters4..7 Reserved Reserved

Each type of APS uses a separate value space foradaptation_parameter_set_id.

An APS NAL unit (having a specific value of adaptation_parameter_set_idand a specific value of aps_params_type) may be shared between pictures,and different slices within a picture may refer to different ALF APSs.

The value of aps_extension_flag equal to 0 indicates that anaps_extension_data_flag syntax element does not exist in the APS RBSPsyntax structure. The value of aps_extension_flag equal to 1 indicatesthat the aps_extension_data_flag syntax element exists in the APS RBSPsyntax structure.

aps_extension_data_flag may have a random value.

As described above, new aps_params_type (PRED_WEIGHT_APS) may be addedto an existing type. Further, the slice header may be modified to signalthe APS ID instead of pred_weight_table( )as shown below in Table 22.

TABLE 22 Descriptor slice_header( ) {  slice_pic_parameter_set_id ue(v)...   if( ( pps_weighted_pred_flag && slice_type == P ) | |    (pps_weighted_bipred_flag && slice_type == B ) )   slice_pred_weight_aps_id u(3) ... }

In Table 22, slice_pred_weight_aps_id indicatesadaptation_parameter_set_id of a prediction weighted table APS.Temporalld of an APS NAL unit having the same aps_params_type asPRED_WEIGHT_APS and the same adaptation_parameter_set_id asslice_pred_weight_aps_id is less than or equal to Temporalld of thecoded slice NAL unit.

When a slice_pred_weight_aps_id syntax element exists in the sliceheader, the value of slice_pred_weight_aps_id is the same for all slicesof the picture.

In this case, a prediction weighted table syntax shown below in Table 23may be signaled.

TABLE 23 Descriptor pred_weight_table( ) {  luma_log2_weight_denom ue(v) if( ChromaArrayType != 0 )   delta_chroma_log2_weight_denom se(v)  num_lists_active_flag u(1)   for( i = 0; i < (num_lists_active_flag ?1 : 2); i++ )    NumRefIdxActive[i] ue(v)  for( i = 0; i <NumRefIdxActive[ 0 ]; i++ )   luma_weight_l0_flag[ i ] u(1)  if(ChromaArrayType != 0 )   for( i = 0; i < NumRefIdxActive[ 0 ]; i++ )    chroma_weight_l0_flag[ i ] u(1)  for( i = 0; i < NumRefIdxActive[ 0]; i++ ) {   if( luma_weight_l0_flag[ i ] ) {     delta_luma_weight_l0[i ] se(v)     luma_offset_l0[ i ] se(v)  }   if( chroma_weight_l0_flag[i ] )    for( j = 0; j < 2; j++ ) {     delta_chroma_weight_l0[ i ][ j ]se(v)     delta_chroma_offset_l0[ i ][ j ] se(v)    }  } if(num_lists_active_flag) {   for( i = 0; i < NumRefIdxActve[ 1 ]; i++)    luma_weight_l1_flag[ i ] u(1)   if( ChromaArrayType != 0 )    for(i = 0; i < NumRefIdxActive[ 1 ]; i++ )     chroma_weight_l1_flag[ i ]u(1)   for( i = 0; i < NumRefIdxActive[ 1 ]; i++ ) {    if(luma_weight_l1_flag[ i ] ) {     delta_luma_weight_l1[ i ] se(v)    luma_offset_l1[ i ] se(v)    }    if( chroma_weight_l1_flag[ i ] )    for( j = 0; j < 2; i++ ) {      delta_chroma_weight_l1[ i ][ j ]se(v)      delta_chroma_offset_l1[ i ][ j ] se(v)     }   }  } }

In Table 23, the value of num_lists_active_flag equal to 1 may indicatethat prediction weighted table information is signaled for one referencepicture list. The value of num_lists_active_flag equal to 0 may indicatethat prediction weight table information for two reference picture listsL0 and L1 is not signaled.

numRefIdxActive[i] may be used to indicate the number of activereference indices.

The value of numRefldxActive[i] is in a range from 0 to 14.

The syntax of Table 23 indicates whether information on one or two listsis parsed in the APS when num_lists_active_flag is parsed.

Instead of Table 23, a prediction weighted table syntax shown below inTable 24 may be used.

TABLE 24 Descriptor pred_weight_table( ) {  luma_log2_weight_denom ue(v) if( ChromaArrayType != 0 )   delta_chroma_log2_weight_denom se(v) num_lists_active_flag u(1)  for( i = 0; i < NumRefIdxActive[ 0 ]; i++ )  luma_weight_l0_flag[ i ] u(1)  if( ChromaArrayType != 0 )   for( i =0; i < NumRefIdxActive[ 0 ]; i++ )    chroma_weight_l0_flag[ i ] u(1) for( i = 0; i < NumRefIdxActive[ 0 ]; i++ ) {   if(luma_weight_l0_flag[ i ] ) {    delta_luma_weight_l0[ i ] se(v)   luma_offset_l0[ i ] se(v)   }   if( chroma_weight_l0_flag[ i ] )   for( j = 0; j < 2; j++ ) {     delta_chroma_weight_l0[ i ][ j ] se(v)    delta_chroma_offset_l0[ i ][ j ] se(v)    }  } if(num_lists_active_flag) {   for( i = 0; i < NumRefIdxActive[ 1 ]; i++)    luma_weight_l1_flag[ i ] u(1)   if( ChromaArrayType != 0 )    for(i = 0; i < NumRefIdxActive[ 1 ]; i++ )     chroma_weight_l1_flag[ i ]u(1)   for( i = 0; i < NumRefIdxActive[ 1 ]; i++ ) {    if(luma_weight_l1_flag[ i ] ) {     delta_luma_weight_l1[ i ] se(v)    luma_offset_l1[ i ] se(v)    }    if( chroma_weight_l1_flag[ i ] )    for( j = 0; j < 2; j++ ) {      delta_chroma_weight_l1[ i ][ j ]se(v)      delta_chroma_offset_l1[ i ][ j ] se(v)     }   }  } }

In Table 24, the value of num_lists_active_flag equal to 1 may indicatethat prediction weight table information is signaled for one referencepicture list. The value of num_lists_active_flag equal to 0 may indicatethat prediction weight table information for two reference picture listsis not signaled.

FIG. 9 and FIG. 10 schematically illustrate an example of a video/imageencoding method and related components according to an embodiment of thepresent document.

The video/image encoding method disclosed in FIG. 9 may be performed bythe (video/image) encoding apparatus 200 disclosed in FIG. 2 and FIG.10. Specifically, for example, S900 and S910 of FIG. 9 may be performedby the predictor 220 of the encoding apparatus 200, and S920 may beperformed by the entropy encoder 240 of the encoding apparatus 200. Thevideo/image encoding method disclosed in FIG. 9 may include theembodiments described above in this document.

Specifically, referring to FIG. 9 and FIG. 10, the predictor 220 of theencoding apparatus may derive motion information on a current block in acurrent picture based on motion estimation (S900). For example, theencoding apparatus may search for a similar reference block having ahigh correlation in fractional pixel units within a predetermined searchrange in a reference picture using an original block in an originalpicture with respect to the current block, and may thus derive themotion information. Similarity of the block may be derived based on adifference between phase-based sample values. For example, thesimilarity of the block may be calculated based on the sum of absolutedifferences (SAD) between the current block (or template of the currentblock) and the reference block (or template of the reference block). Inthis case, the motion information may be derived based on a referenceblock having the smallest SAD in a search area. The derived motioninformation may be signaled to the decoding apparatus based on an interprediction mode according to various methods.

The predictor 220 of the encoding apparatus may perform intra predictionor inter prediction on the current block based on the motion informationon the current block, thereby generating prediction samples (predictionblock) and prediction-related information for the current block. Theprediction-related information may include prediction mode information(merge mode, skip mode, or the like), information on motion information,and the like. The information on the motion information may includecandidate selection information (e.g., a merge index, an mvp flag, or anmvp index) that is information for deriving a motion vector. Further,the information on the motion information may include information on anMVD described above and/or reference picture index information. Inaddition, the information on the motion information may includeinformation indicating whether L0 prediction, L1 prediction, orbi-prediction is applied. For example, when the slice type of a currentslice is a P slice or a B slice, the predictor 220 may perform weightedprediction on the current block in the current slice. The weightedprediction may be used when not only bi-prediction but alsouni-prediction is applied to the current block.

Further, the predictor 220 of the encoding apparatus may performweighted prediction based on the motion information, thereby generatingweighting factor-related information for a reference picture list forthe weighted prediction and number information on weighted referencepictures in the reference picture list (S910). In this case, the entropyencoder 240 of the encoding apparatus may encode image informationincluding the weighting factor-related information and the numberinformation (S920). The number information may be included in theprediction weighted table syntax in the image information, and even inthis case, the prediction weighted table syntax may be included in thepicture header in the image information. Here, the value of the numberinformation may be the same as the number of the weighted referencepictures in the reference picture list. The prediction weighted tablesyntax may include as many weighting factor-related flags as the valueof the number information. For example, when the value of the numberinformation is n, the prediction weighted table syntax may include nweighting factor-related flags. When weighted bi-prediction is applied,number information and/or a weighting factor-related flag may beindependently included for each of L0 and L1 in the prediction weightedtable syntax. In other words, number information on weighted referencepictures in L0 and number information on weighted reference pictures inL1 may be independently signaled in the prediction weighted table syntaxwithout depending on each other (without depending on the number ofactive reference pictures for each list).

The residual processor 230 of the encoding apparatus may generateresidual samples and residual information based on the predictionsamples generated by the predictor 220 and the original picture(original block and original samples). Here, the residual information isinformation on the residual samples, and may include information on(quantized) transform coefficients for the residual samples.

The adder (or reconstructor) of the encoding apparatus may generatereconstructed samples (reconstructed picture, reconstructed block, orreconstructed sample array) by adding the residual samples generated bythe residual processor 230 and the prediction samples generated by thepredictor 220.

The entropy encoder 240 of the encoding apparatus may encode the imageinformation including the prediction-related information generated bythe predictor 220, the residual information generated by the residualprocessor 230, a flag (information) related to the weighted prediction,a prediction weighted table syntax, and the like.

For example, the entropy encoder 240 of the encoding apparatus mayencode the image information based on at least one of Table 5 to Table23 and may output the encoded image information in the form of abitstream. Specifically, the entropy encoder 240 of the encodingapparatus may determine the value of the flag related to the weightedprediction as 1 based on the prediction weighted table syntax of thepresent document being included in a picture header of the imageinformation, and may determine the value of the flat related to theweighted prediction as 0 based on the prediction weighted table syntaxbeing included in a slice header of the image information.Alternatively, the entropy encoder 240 of the encoding apparatus maydetermine the value of the flag related to the weighted prediction as 1based on information on the weighted prediction included in theprediction weighted table syntax being applied to all slices in thecurrent picture including the current block, and may determine the valueof the flag related to the weighted prediction as 0 based on theinformation on the weighted prediction included in the predictionweighted table syntax being applied to a slice associated with the sliceheader among the slices in the current picture. When the predictionweighted table syntax is included in the picture header, all slicesassociated with the picture header in the picture may have the samereference picture list, and when the prediction weighted table syntax isincluded in the slice header, the slices associated with the sliceheader may have the same reference picture list. The flag related to theweighted prediction may be included in a picture parameter set or thepicture header of image information and be transmitted to the decodingapparatus. The flag related to the weighted prediction may beinformation indicating whether the information on the weightedprediction exists in the picture header.

FIG. 11 and FIG. 12 schematically illustrate an example of a video/imagedecoding method and related components according to an embodiment of thepresent document.

The video/image decoding method disclosed in FIG. 11 may be performed bythe (video/image) decoding apparatus 300 disclosed in FIG. 3 and FIG.12. Specifically, for example, S1100 to S1020 of FIG. 11 may beperformed by the entropy decoder 310 of the decoding apparatus. S1130 ofFIG. 11 may be performed by the predictor 330 of the decoding apparatus,and S1140 may be performed by the residual processor 320 of the decodingapparatus. S1150 of FIG. 11 may be performed by the adder 340 of thedecoding apparatus. The video/image decoding method disclosed in FIG. 11may include the embodiments described above in this document.

Referring to FIG. 11 and FIG. 12, the entropy decoder 310 of thedecoding apparatus may parse a flag related to weighted prediction froma bitstream, and may parse a prediction weighted table syntax from thebitstream based on the flag related to the weighted prediction (S1100).The flag related to the weighted prediction may be parsed from a pictureparameter set or a picture header of the bitstream, and may indicatewhether information on the weighted prediction (prediction weightedtable syntax) exists in the picture header. For example, when the valueof the flag related to the weighted prediction is 1, the entropy decoder310 of the decoding apparatus may parse the prediction weighted tablesyntax from the picture header of the bitstream, and when the value ofthe flag related to the weighted prediction is 0, the entropy decoder310 of the decoding apparatus may parse the prediction weighted tablesyntax from a slice header of the bitstream. When the value of the flagrelated to the weighted prediction is 1, the information on the weightedprediction included in the prediction weighted table syntax may beapplied to all slices in a current picture, and when the value of theflag related to the weighted prediction is 0, the information on theweighted prediction included in the prediction weighted table syntax maybe applied to a slice associated with the slice header among the slicesin the current picture. When the prediction weighted table syntax isparsed from the picture header, all slices associated with the pictureheader in the picture may have the same reference picture list, and whenthe prediction weighted table syntax is parsed from the slice header,the slices associated with the slice header may have the same referencepicture list.

The entropy decoder 310 of the decoding apparatus may parse numberinformation on weighted reference pictures in a reference picture listfrom the prediction weighted table syntax (1110). The value of thenumber information may be the same as the number of weighted referencepictures in the reference picture list. The entropy decoder 310 of thedecoding apparatus may parse or derive as many weighting factor-relatedflags as the value of the number information from the predictionweighted table syntax based on the number information (S1120). Forexample, when the value of the number information is n, the predictionweighted table syntax may include n weighting factor-related flags. Whenweighted bi-prediction is applied, number information and/or a weightingfactor-related flag may be independently included for each of L0 and L1in the prediction weighted table syntax. In one example, numberinformation on weighted reference pictures in L0 and number informationon weighted reference pictures in L1 may be independently parsed in theprediction weighted table syntax without depending on each other(without depending on the number of active reference pictures for eachlist).

The decoding apparatus may perform weighted prediction on a currentblock in the current picture based on prediction-related information(inter/intra prediction classification information, intra predictionmode information, inter prediction mode information, the information onthe weighted prediction, or the like) obtained from the bitstream,thereby reconstructing the current picture. Here, the information on theweighted prediction may include the prediction weighted table syntax.For example, the predictor 330 of the decoding apparatus may deriveweightings for the weighted prediction based on the weightingfactor-related flags parsed based on the number information in theprediction weighted table syntax. Specifically, the value of the numberinformation in the prediction weighted table syntax is n, the predictor330 of the decoding apparatus may parse n weighting factor-related flagsfrom the prediction weighted table syntax. The predictor 330 of thedecoding apparatus may perform the weighted prediction on the currentblock based on the weightings, thereby deriving prediction samples forthe current block (S1130).

The residual processor 320 of the decoding apparatus may generateresidual samples based on residual information obtained from thebitstream (S1140). The adder 340 of the decoding apparatus may generatereconstructed samples based on the prediction samples generated by thepredictor 330 and the residual samples generated by the residualprocessor 320. The adder 340 of the decoding apparatus may generate areconstructed picture (reconstructed block) based on the reconstructedsamples (S1150).

Subsequently, if necessary, an in-loop filtering procedure, such asdeblocking filtering, SAO, and/or ALF, may be applied to thereconstructed picture in order to improve subjective/objective picturequality.

Although methods have been described on the basis of a flowchart inwhich steps or blocks are listed in sequence in the above-describedembodiments, the steps of the present document are not limited to acertain order, and a certain step may be performed in a different stepor in a different order or concurrently with respect to that describedabove. Further, it will be understood by those ordinary skilled in theart that the steps of the flowcharts are not exclusive, and another stepmay be included therein or one or more steps in the flowchart may bedeleted without exerting an influence on the scope of the presentdocument.

The aforementioned method according to the present document may be inthe form of software, and the encoding apparatus and/or decodingapparatus according to the present document may be included in a devicefor performing image processing, for example, a TV, a computer, a smartphone, a set-top box, a display device, or the like.

When the embodiments of the present document are implemented bysoftware, the aforementioned method may be implemented by a module(process or function) which performs the aforementioned function. Themodule may be stored in a memory and executed by a processor. The memorymay be installed inside or outside the processor and may be connected tothe processor via various well-known means. The processor may includeApplication-Specific Integrated Circuit (ASIC), other chipsets, alogical circuit, and/or a data processing device. The memory may includea Read-Only Memory (ROM), a Random Access Memory (RAM), a flash memory,a memory card, a storage medium, and/or other storage device. In otherwords, the embodiments according to the present document may beimplemented and executed on a processor, a micro-processor, acontroller, or a chip. For example, functional units illustrated in therespective figures may be implemented and executed on a computer, aprocessor, a microprocessor, a controller, or a chip. In this case,information on implementation (for example, information on instructions)or algorithms may be stored in a digital storage medium.

In addition, the decoding apparatus and the encoding apparatus to whichthe embodiment(s) of the present document is applied may be included ina multimedia broadcasting transceiver, a mobile communication terminal,a home cinema video device, a digital cinema video device, asurveillance camera, a video chat device, and a real time communicationdevice such as video communication, a mobile streaming device, a storagemedium, a camcorder, a video on demand (VoD) service provider, an OverThe Top (OTT) video device, an internet streaming service provider, a 3Dvideo device, a Virtual Reality (VR) device, an Augment Reality (AR)device, an image telephone video device, a vehicle terminal (forexample, a vehicle (including an autonomous vehicle) terminal, anairplane terminal, or a ship terminal), and a medical video device; andmay be used to process an image signal or data. For example, the OTTvideo device may include a game console, a Blu-ray player, anInternet-connected TV, a home theater system, a smartphone, a tablet PC,and a Digital Video Recorder (DVR).

In addition, the processing method to which the embodiment(s) of thepresent document is applied may be produced in the form of a programexecuted by a computer and may be stored in a computer-readablerecording medium. Multimedia data having a data structure according tothe embodiment(s) of the present document may also be stored in thecomputer-readable recording medium. The computer readable recordingmedium includes all kinds of storage devices and distributed storagedevices in which computer readable data is stored. The computer-readablerecording medium may include, for example, a Blu-ray disc (BD), auniversal serial bus (USB), a ROM, a PROM, an EPROM, an EEPROM, a RAM, aCD-ROM, a magnetic tape, a floppy disk, and an optical data storagedevice. The computer-readable recording medium also includes mediaembodied in the form of a carrier wave (for example, transmission overthe Internet). In addition, a bitstream generated by the encoding methodmay be stored in the computer-readable recording medium or transmittedthrough a wired or wireless communication network.

In addition, the embodiment(s) of the present document may be embodiedas a computer program product based on a program code, and the programcode may be executed on a computer according to the embodiment(s) of thepresent document. The program code may be stored on a computer-readablecarrier.

FIG. 13 represents an example of a contents streaming system to whichthe embodiment of the present document may be applied.

Referring to FIG. 13, the content streaming system to which theembodiments of the present document is applied may generally include anencoding server, a streaming server, a web server, a media storage, auser device, and a multimedia input device.

The encoding server functions to compress to digital data the contentsinput from the multimedia input devices, such as the smart phone, thecamera, the camcorder and the like, to generate a bitstream, and totransmit it to the streaming server. In another example, in a case inwhich the multimedia input device, such as, the smart phone, the camera,the camcorder or the like, directly generates a bitstream, the encodingserver may be omitted.

The bitstream may be generated by an encoding method or a bitstreamgeneration method to which the embodiments of the present document isapplied. And the streaming server may temporarily store the bitstream ina process of transmitting or receiving the bitstream.

The streaming server transmits multimedia data to the user equipment onthe basis of a user's request through the web server, which functions asan instrument that informs a user of what service there is. When theuser requests a service which the user wants, the web server transfersthe request to the streaming server, and the streaming server transmitsmultimedia data to the user. In this regard, the contents streamingsystem may include a separate control server, and in this case, thecontrol server functions to control commands/responses betweenrespective equipment in the content streaming system.

The streaming server may receive contents from the media storage and/orthe encoding server. For example, in a case the contents are receivedfrom the encoding server, the contents may be received in real time. Inthis case, the streaming server may store the bitstream for apredetermined period of time to provide the streaming service smoothly.

For example, the user equipment may include a mobile phone, a smartphone, a laptop computer, a digital broadcasting terminal, a personaldigital assistant (PDA), a portable multimedia player (PMP), anavigation, a slate PC, a tablet PC, an ultrabook, a wearable device(e.g., a watch-type terminal (smart watch), a glass-type terminal (smartglass), a head mounted display (HMD)), a digital TV, a desktop computer,a digital signage or the like.

Each of servers in the contents streaming system may be operated as adistributed server, and in this case, data received by each server maybe processed in distributed manner

1. A video decoding method performed by a video decoding apparatus, themethod comprising: parsing number information on weighted referencepictures in a reference picture list from a prediction weighted tablesyntax; deriving weighting factor-related flag information for thereference picture list based on the number information; derivingprediction samples for a current block by performing weighted predictionon the current block based on the weighting factor-related flaginformation; generating residual samples based on residual informationobtained from the bitstream; and reconstructing a current picture basedon the prediction samples and the residual samples, wherein theprediction weighted table syntax is comprised in a picture header of thebitstream.
 2. The video decoding method of claim 1, wherein a value ofthe number information is the same as a number of the weighted referencepictures in the reference picture list.
 3. The video decoding method ofclaim 1, wherein the weighting factor-related flag information comprisesat least one of a luma_weight_10_flag syntax element or aluma_weight_11_flag syntax element.
 4. The video decoding method ofclaim 1, wherein the parsing of the weighting factor-related flaginformation comprises parsing n weighting factor-related flags from theprediction weighted table syntax based on a value of the numberinformation being n. 5-8. (canceled)
 9. The video decoding method ofclaim 1, wherein all slices associated with the picture header in thepicture have the same reference picture list.
 10. (canceled).
 11. Avideo encoding method performed by a video encoding apparatus, themethod comprising: deriving motion information on a current block;performing weighted prediction on the current block based on the motioninformation; generating weighting factor-related flag information for areference picture list for the weighted prediction and numberinformation on weighted reference pictures in the reference picturelist; and encoding image information comprising the weightingfactor-related flag information and the number information, wherein theweighting factor-related flag information and the number information arecomprised in a prediction weighted table syntax in the imageinformation, and wherein the prediction weighted table syntax iscomprised in a picture header of the image information.
 12. The videoencoding method of claim 11, wherein a value of the number informationis the same as a number of the weighted reference pictures in thereference picture list.
 13. The video encoding method of claim 11,wherein the weighting factor-related flag information comprises at leastone of a luma_weight_10_flag syntax element or a luma_weight_11_flagsyntax element.
 14. The video encoding method of claim 11, wherein theprediction weighted table syntax comprises n weighting factor-relatedflags based on a value of the number information being n.
 15. Anon-transitory computer-readable digital storage medium storing abitstream generated by a video encoding method, the video encodingmethod comprising: deriving motion information on a current block;performing weighted prediction on the current block based on the motioninformation; generating weighting factor-related flag information for areference picture list for the weighted prediction and numberinformation on weighted reference pictures in the reference picture list; and encoding image information to generate the bitstream, wherein theimage information comprises the weighting factor-related flaginformation and the number information, wherein the weightingfactor-related flag information and the number information are comprisedin a prediction weighted table syntax in the image information, andwherein the prediction weighted table syntax is comprised in a pictureheader of the image information.